Borders

T

timhaynes1985

Hi, I have in a div at the top of my page an image (banner) which has
its own white borders on the left and right. The divs below that are
the same width as the div containing the image i have used the css
border command. However when the page is viewed through a browser the
border of the divs below stick out 1 px more than the image. Is there
anyway of getting around this? Many thanks!
 
T

tech578

Hi, I have in a div at the top of my page an image (banner) which has
its own white borders on the left and right. The divs below that are
the same width as the div containing the image i have used the css
border command. However when the page is viewed through a browser the
border of the divs below stick out 1 px more than the image. Is there
anyway of getting around this? Many thanks!

Make the div 2px less to allow for border.
 
R

rf

Hi, I have in a div at the top of my page an image (banner) which has
its own white borders on the left and right. The divs below that are
the same width as the div containing the image i have used the css
border command.

CSS does not have commands. It has rules.
However when the page is viewed through a browser the
border of the divs below stick out 1 px more than the image.

Damn. A whole pixel.? Bugger. That's really ruin your day :)
Is there
anyway of getting around this? Many thanks!

URL?
 
J

Jonathan N. Little

rf said:
CSS does not have commands. It has rules.


Damn. A whole pixel.? Bugger. That's really ruin your day :)


URL?

Let me guess, the OP does not realize that borders add to an elements
width and height....
 
J

Jeff

Jonathan said:
Let me guess, the OP does not realize that borders add to an elements
width and height....

Well don't you find that a little irritating? Everyone says "Strict
Doctype". But what you get is this weird box model where the width is
not the width of the box. More than a little irritating when you have a
series of boxes that you want to fit in 100%, but you can't because you
have to figure out what the real width is and that includes borders and
padding which are never specified in %. And then we blame people for
using px to specify widths.

Well, that's my rant for the day. And I'm sure someday there will be
a reasonable fix, it just won't be soon. Frankly, I'm not surprised
there are so many sites running quirks mode.

Jeff
 
J

Jonathan N. Little

Jeff said:
Jonathan N. Little wrote:

Well don't you find that a little irritating? Everyone says "Strict
Doctype". But what you get is this weird box model where the width is
not the width of the box. More than a little irritating when you have a
series of boxes that you want to fit in 100%, but you can't because you
have to figure out what the real width is and that includes borders and
padding which are never specified in %. And then we blame people for
using px to specify widths.

Hmmm, so use quirks mode and let each browser interpret the box model
anyway they wish, (now there will be predictable consistency!) Back in
the 90's when browsers were competing to make their own special display
model web design was a real b*tch. Forked code galore! Now at least we
have have only one fork, the "right way" and "IE's way". ;-)

Actually if you are careful to not trigger quirks mode IE will be
constant with all other browsers most of the time, and maybe if IE8
lives up to MS's hype it will be more predictable in the future. So I
would say, maybe you just need to learn how the proper box model, eh?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top