juanrojo1987 Posted January 3, 2015 Share Posted January 3, 2015 Hi everybody! I'm trying to solve a problem with my css and html code in my site peliculas online. When I analyze this site in the w3c validator (http://validator.w3.org/) it shows a bad use of the tag <center></center> and I really don't know how to fix that. Could someone help me with this? Perhaps you know about another way to center the content. I had just tried with text-align:center; and margin: 0px auto; but nothing good appear. Line 183, Column 8: The center element is obsolete. Use CSS instead. <center><div id="wrapperall"> ✉ Line 563, Column 8: The center element is obsolete. Use CSS instead. <center><div id="container"> Thanks a lot! Link to comment Share on other sites More sharing options...
Ingolme Posted January 3, 2015 Share Posted January 3, 2015 If it's a block element, like <div>, give it a specified width and then set the left and right margins to "auto". It it's text, or an inline element, then set text-align to center on the parent element. Link to comment Share on other sites More sharing options...
funbinod Posted January 4, 2015 Share Posted January 4, 2015 read http://www.w3schools.com/css/css_align.asp and see example http://jsfiddle.net/a2jwavuc/ Link to comment Share on other sites More sharing options...
kelly2marie Posted January 11, 2015 Share Posted January 11, 2015 In regards to <center><div id="container"> If you are trying to center the div itself, specify a width AND auto margins for the left and right. (the width can be pixels, ems, or percentage) #container {width:90%; margin:0 auto;} If you need to center content within a particular div, then you would use text-align:center as follows: #container {text-align:center;} Or............. let's say you would like to center the contents of a paragraph using an inline style.... HTML: <p style="text-align:center;">Content here. </p> Or, create a class on your external style sheet called "center" as follows.... .class {text-align:center;} Then apply this class to the element you want to center the content, such as a paragraph.... <p class="center">Content here.</p> Link to comment Share on other sites More sharing options...
sallyjoshua Posted January 12, 2015 Share Posted January 12, 2015 center is a deprecated element u should use text-align for inline text centering and margin:0 auto for block level elements. so as long as the center element is in ur code it will not be valide Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now