1 reply [Last post]
dazibest
Offline
newbie
Last seen: 12 years 25 weeks ago
Joined: 2009-11-28
Posts: 1
Points: 2

I am building a site with a full width header, navigation and footer and I am wanting to align the nav and footer copy centrally but still have it left aligned. I have tried using text indent but on smaller screen sizes it doesn't work as the copy stays where it is no matter what size screen it is viewed on.

Is this possible? If so how?

Cheers in advanced.

Daz

ljbailey
ljbailey's picture
Offline
Enthusiast
Scotland
Last seen: 11 years 27 weeks ago
Scotland
Joined: 2009-01-10
Posts: 224
Points: 59

You need to set the width of

You need to set the width of the elements you want center aligned, and use margin:0 auto to center align them to the screen, i.e. It is also a good idea to use text-align:center on the body element for older browsers.

body {
width:100%;
background:blue;
text-align:center
}
 
#mynav {
width:900px;
margin:0 auto;
text-align:left
}

This will only work if you use a dtd.

Liam Bailey is director of Galloway Web Services, a Stranraer web design company, sister of SEO copywriting services company Write About Property.