Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Help 

HTML <center> not centering fully

Hey guys, I have a problem. When I use the <center> tag, it doesn't center it fully. Whatever I try to center is still leaning towards the left side.

[Image: OyDerDX.png]
You shouldn't even be using that tag. It's not supported in HTML5. Use CSS for centering.
(Jun 8, 2014 05:49 PM)c0nvex Wrote:  You shouldn't even be using that tag. It's not supported in HTML5. Use CSS for centering.

Pretty much this; however, HTML5 does not practice deprecation. There are only features and obsolete features; therefore, <center> may be obsolete, however the specification still requires that browsers support it. So you can continue to use it, but it's considered obsolete and not recommended.

The reason for making <center> obsolete was because the specification is now trying to push web developers into the separation of page content and page styling.

But to solve your problem, we need the code.
Convex. Wrote:You shouldn't even be using that tag. It's not supported in HTML5. Use CSS for centering.
This, but maybe its a monitor issue or something?
Send me the website or coding, ill take a look.
它是它是什麼

Use CSS instead.
PHP Code

<?php 
<style>
body{
    
margin: 0;
    
padding: 0;
}
.
container{
    
background-color: red;
    
width: 1024px;
    
height: 100%;
    
margin: 0 auto;
}
</
style>
<
div class='container'></div> 
Motocross is a lifestyle!
(Jun 8, 2014 08:12 PM)SirBuck777 Wrote:  Pretty much this; however, HTML5 does not practice deprecation. There are only features and obsolete features; therefore, <center> may be obsolete, however the specification still requires that browsers support it. So you can continue to use it, but it's considered obsolete and not recommended.

The reason for making <center> obsolete was because the specification is now trying to push web developers into the separation of page content and page styling.

But to solve your problem, we need the code.

You're wrong. The <center> tag was deprecated in HTML 4.1 and has been removed from the specification, going on a few years now. It's the browsers themselves that chose to still support it, but not all browsers do.
(Jun 9, 2014 02:16 AM)~Dec Wrote:  You're wrong. The <center> tag was deprecated in HTML 4.1 and has been removed from the specification, going on a few years now. It's the browsers themselves that chose to still support it, but not all browsers do.

Oh, my bad. I thought <center> was only recently removed in HTML5 where the specification no longer deprecates features. Sorry!


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Help] by grailAug 5, 2018 01:06 PM 5 270 Aug 5, 2018 01:06 PM
Last Post: Nachfolger
by HuskarAug 5, 2018 12:46 PM 2 240 Aug 5, 2018 12:46 PM
Last Post: petercraig
[Help] by ExodianJul 30, 2015 07:20 PM 5 99 Jul 30, 2015 07:20 PM
Last Post: Exodian