vchris Posted September 7, 2006 Share Posted September 7, 2006 I have this code for my container #container { width: 600px; margin: 0 auto; } So basically I have a centered container on my page which I want to add some margins into it so the text is not right against the borders.I tried with padding but this creates spaces outside the container and I no longer have my width of 600px. If I try margins then the container is no longer centered and is placed depending on the margins I specified. I don't understand why it's not working, I've done it before.Thanks for the help. Link to comment Share on other sites More sharing options...
Err Posted September 7, 2006 Share Posted September 7, 2006 Have your tried adding a span's for your text? You can have your container with your styling, but you can also have your text with it's own styling... something like this:html: <div id="container"><span>Text Here</span></div> css: #container { width: 600px; margin: 0 auto; }#container span {padding: 3px;} Maybe? Link to comment Share on other sites More sharing options...
vchris Posted September 7, 2006 Author Share Posted September 7, 2006 I haven't tried but then that means that everything would have to be within span tags... Kinda makes the code dirty. Link to comment Share on other sites More sharing options...
Err Posted September 7, 2006 Share Posted September 7, 2006 So it's not just for one container I'm assuming then. Well, that's really all I can come up with. Perhaps someone else can give you a better suggestion then. Link to comment Share on other sites More sharing options...
vchris Posted September 7, 2006 Author Share Posted September 7, 2006 Resolved. I just added some margins on the inner containers (header, content, footer...) 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