HighDots Forums  

Borders - inside or out?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Borders - inside or out? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
chudzikr@gmail.com
 
Posts: n/a

Default Borders - inside or out? - 09-29-2006 , 09:44 AM






Hi-

I have a question that I haven't been able to find any info on:

If I have an element (say, a <div> or a <table>) which is a certain
fixed width (let's say 500px).

If I add a CSS border of 2 px, does the element:

a) become 504px wide, or
b) does the inner area of the element become 496px wide?

Basically, I'm trying to find out of the border takes up space on the
outside or the inside of the element.

Any help would be appreicated!

Thanks,

Rob


Reply With Quote
  #2  
Old   
Andy Dingley
 
Posts: n/a

Default Re: Borders - inside or out? - 09-29-2006 , 10:17 AM







chudzikr (AT) gmail (DOT) com wrote:

Quote:
Basically, I'm trying to find out of the border takes up space on the
outside or the inside of the element.
Elements are things in the source code of the document. When they're
rendered onto the page we usually call them boxes. Look up "CSS box
model" for explanations - brainjar.com has one of the better ones.

As to your "inside or outside ?" question, then this si something that
IE infamously got wrong to begin with. make sure you research "IE
quirks mode rendering" too.



Reply With Quote
  #3  
Old   
Ben C
 
Posts: n/a

Default Re: Borders - inside or out? - 09-29-2006 , 10:28 AM



On 2006-09-29, chudzikr (AT) gmail (DOT) com <chudzikr (AT) gmail (DOT) com> wrote:
Quote:
Hi-

I have a question that I haven't been able to find any info on:

If I have an element (say, a <div> or a <table>) which is a certain
fixed width (let's say 500px).

If I add a CSS border of 2 px, does the element:

a) become 504px wide, or
b) does the inner area of the element become 496px wide?
(a) for most things, but (b) for tables!

Quote:
Basically, I'm trying to find out of the border takes up space on the
outside or the inside of the element.
On the outside generally speaking, but tables and tds are a bit
different. I suspect this goes back to HTML table attributes, where
"width" specifies "the desired width of the entire table".


Reply With Quote
  #4  
Old   
chudzikr@gmail.com
 
Posts: n/a

Default Re: Borders - inside or out? - 09-29-2006 , 11:51 AM



thanks, Ben -- that's exactly what I was looking for!
Ben C wrote:
Quote:
On 2006-09-29, chudzikr (AT) gmail (DOT) com <chudzikr (AT) gmail (DOT) com> wrote:
Hi-

I have a question that I haven't been able to find any info on:

If I have an element (say, a <div> or a <table>) which is a certain
fixed width (let's say 500px).

If I add a CSS border of 2 px, does the element:

a) become 504px wide, or
b) does the inner area of the element become 496px wide?

(a) for most things, but (b) for tables!

Basically, I'm trying to find out of the border takes up space on the
outside or the inside of the element.

On the outside generally speaking, but tables and tds are a bit
different. I suspect this goes back to HTML table attributes, where
"width" specifies "the desired width of the entire table".


Reply With Quote
  #5  
Old   
chudzikr@gmail.com
 
Posts: n/a

Default Re: Borders - inside or out? - 09-29-2006 , 12:27 PM



Thanks, -- brainjar is a good resource.
chudzikr (AT) gmail (DOT) com wrote:
Quote:
Hi-

I have a question that I haven't been able to find any info on:

If I have an element (say, a <div> or a <table>) which is a certain
fixed width (let's say 500px).

If I add a CSS border of 2 px, does the element:

a) become 504px wide, or
b) does the inner area of the element become 496px wide?

Basically, I'm trying to find out of the border takes up space on the
outside or the inside of the element.

Any help would be appreicated!

Thanks,

Rob


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.