Freeola Internet Get Dotted Domains Gaming & Extras
Freeola Gameaday
 
Browse Chat Forums:
 Chat Forums Home Latest Message Chat Rules Chat Safety & Tips Top Posters How to Win Gameaday View the Winners List Update Your Profile See Who's Online
  Free Web Site  Free Domain Hosting  Emergency Internet  Broadband Offers
 

Premium Customer Support

count down top left count down top count down top right
0000000000000000
base count down

Visit our Support Pages E-mail a Support Request Contact Us

8Mb Max VIP Office Grade Broadband Now Available!

nothing
Just lurking around? Why not join in? You could win free games just by chatting. Choose your Nickname in MyFreeola, or Sign Up Here.
 
you are here
chat line Freeola Chat Forums (72)
Chat Rooms & Users Online
Web Sites & Internet
"CSS Wrapper problem"
search
 
Login or Create Free Account
Create & Run Your Own Forum
Sell Domain Names
 
Browsing the Freeola Chat Forums...
 
After the original message, all posts and replies are shown in reverse order, with the most recent post at the top. i.e. your latest post will always appear under the original message, at the top of the first page.
 
To display oldest posts first, click the 'Flip Order - Oldest First' link below.
Close This Tip
 
Back To Threads Post a Reply  
 
 
CSS Wrapper problem There are 3 replies
Original Message posted by Machie on 14/07/2008 at 12:57:28PM
Okay I'm really stuck and I need some help.

I'm trying to add coloured borders (left and right) to my site. So I give my body tag a colour, then make my wrapper/container white.

Now how do I create a margin between the background colour and the content so they arent right next to each other?

Usually I would just add padding: 10px; to the wrapper div and add 20px to the width. But for some reason this doesnt work anymore.

I'm pretty sure it use to be...

content + padding = width


Using margin will only create space outside the container so it'll still place the content right next to the background. Plus I'm already using margin-left: auto; margin-right: auto; which I use to centre the wrapper (is this how everyone does it now?)

So yeah I'm stuck and starting to get a headache. Should I stick with the 10px padding or use something else? I want to do it the right way and not the "this will do for now" way.

Any help much appreciated.
 
 Replies To This Post:
 
Garin
"Devil in disguise"
on 14/07/2008 at 10:30:09PM
Edited: 21/7/08 12:57
Total Posts: 1676
I take it this has been fixed?
 
Machie
on 14/07/2008 at 9:15:24PM
Total Posts: 10418
Thank you very much McLong :D, I think I'll use that.
 
McLong
on 14/07/2008 at 1:35:49PM
Edited: 15/7/08 8:24
Total Posts: 167
I think IE and FF treat this differently.

Where one applies padding on top of the original width, the other one doesn't.

I believe you'd need two wrappers, one a fixed width, then another with width 100% and padding, for example:

I've used inline styling so it's easier to work out which styling is applied to which element.


<body style="background: #666; margin: 0; text-align: center;">
    <div style="width: 1000px; background: #FFF;">
        <div style="width: 100%; padding: 0px 10px 0px 10px;">
           
Content here
        </div>
    </div>
</body>


I'm sure there's an IE hack you can use, or that Garin/Eccles will find a better solution. But I'm confident that will work.
 
Machie
on 14/07/2008 at 12:57:28PM
Total Posts: 10418
Okay I'm really stuck and I need some help.

I'm trying to add coloured borders (left and right) to my site. So I give my body tag a colour, then make my wrapper/container white.

Now how do I create a margin between the background colour and the content so they arent right next to each other?

Usually I would just add padding: 10px; to the wrapper div and add 20px to the width. But for some reason this doesnt work anymore.

I'm pretty sure it use to be...

content + padding = width


Using margin will only create space outside the container so it'll still place the content right next to the background. Plus I'm already using margin-left: auto; margin-right: auto; which I use to centre the wrapper (is this how everyone does it now?)

So yeah I'm stuck and starting to get a headache. Should I stick with the 10px padding or use something else? I want to do it the right way and not the "this will do for now" way.

Any help much appreciated.
 
 
MyFreeola Internet Settings Control Panel
Login or take a free look around.
Free Account Sign-Up
Freeola Gameaday
Today's Winner
Nickname: Hannard
Entry: Review Post
 
Fantastic FREE Unlimited Services for every freeola internet
customer in the UK!
Register Domain Names. Buy from £2.99
e.g. yourcompany.com
or just yourcompany.
OR VISIT GETDOTTED.COM