6 replies [Last post]
James R
James R's picture
Offline
Enthusiast
Dublin
Last seen: 9 years 28 weeks ago
Dublin
Timezone: GMT+1
Joined: 2007-10-19
Posts: 108
Points: 13

What are peoples stance on this?!

I found it was the easiest work around for me to use two empty divs with fixed width and height and bg colour to produce a couple of gutter like effects to break up my page.

Should I ditch the empty divs and image replace some text?!

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 6 years 19 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

If I understand your problem

If I understand your problem correctly, you should use a combination of padding, borders, margins and background colours as appropriate.

Enjoy > http://www.cssplay.co.uk/index

Life's a b*tch and then you die!

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 16 hours 17 min ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9745
Points: 3824

The specs say that empty

The specs say that empty <p>s "should" be ignored and "strongly suggests" that other empty block elements be ignored. You're depending on non-defined behavior. At any time, a browser could do as suggested, and you'd have no legitimate complaint. Use margins, padding, etc., as Roy suggests.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

James R
James R's picture
Offline
Enthusiast
Dublin
Last seen: 9 years 28 weeks ago
Dublin
Timezone: GMT+1
Joined: 2007-10-19
Posts: 108
Points: 13

Here's my main content layout...

Maybe I will just get rid of the empty divs and change bg colours. Although I wonder will it interfere with my faux columns hmm

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 6 years 19 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

Try something simple like

Try something simple like this:

#div-in-the-middle {
border-top: 5px solid #FFF;
border-bottom: 5px solid #FFF;
}

...or use margins and an overall background colour of white.

Life's a b*tch and then you die!

James R
James R's picture
Offline
Enthusiast
Dublin
Last seen: 9 years 28 weeks ago
Dublin
Timezone: GMT+1
Joined: 2007-10-19
Posts: 108
Points: 13

Brilliant, why didn't I

:ohdear: Brilliant, why didn't I think of that!!

I suppose I have always associated borders being completely around divs :blushing:

Cheers Roy!!

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 6 years 19 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

You're very welcome

You're very welcome Smile

Life's a b*tch and then you die!