Why is my div element not centering?

To center the footer contents horizontally, just add the following CSS.

To center the footer contents horizontally, just add the following CSS: #footer { text-align: center; } Demo: jsfiddle.net/mathias/GZ6xh/ If you’re looking to center the entire element, just give it a width and then use margin: 0 auto: #footer { width: 400px; margin: 0 auto; }.

That's not standard compliant but thank you, though. :) – Tyler Crompton Mar 24 at 9:30 This method centers the text inside, not the element itself – Alex Mar 24 at 9:41 @Tyler Crompton: How is this not standards compliant? It is.

– Mathias Bynens Mar 24 at 9:46 @Alex: The question wasn’t really clear IMHO. I’ve edited my answer now. – Mathias Bynens Mar 24 at 9:48 Noted, and down vote removed :-) – Alex Mar 24 at 9:51.

The width of ul#footer is undefined, so it uses the default width of "100%". I tried using width:261px, and then it does center.

Right you are. In order to use margin: auto; as a method of centering a block-level element you'd need to specify a width, otherwise it would take up 100% of the width anyway – Alex Mar 24 at 9:42.

I find two solutions: both here, one is commented: jsfiddle.net/AzNqm/ define width of ul, and center block with margin:auto center inner li elements Effect will be the same.

Tyler: I think you’re confusing the CSS text-align property with the deprecated align attribute in HTML. There’s nothing wrong with text-align, no matter how you use it. – Mathias Bynens Mar 24 at 9:54 Accidentally deleted the comment trying to edit it.

Yes, that's what I thinking about. Little did I know it, though. Lol.Thanks.

:) – Tyler Crompton Mar 24 at 9:56.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions