Topic: Padding expands my width (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=11165" title="Pages that link to Topic: Padding expands my width (Page 1 of 1)" rel="nofollow" >Topic: Padding expands my width <span class="small">(Page 1 of 1)</span>\

 
Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 03-05-2004 16:20

Howdy,
Is it normal for padding to expand the width of its block? As in:

<div id="page_main"/>

#page_main {
padding: 15px;
width: 700px;
background-color: #ffffff;
}

Looked good before (with no Padding - and sized up well with an image above 700PX wide), but when I added the padding value, the block got wider (I'm guessing, 30PX wider).

Karl

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 03-05-2004 16:34

Yes, this is normal. Annoying, but correct.

CSS 3 (i think) contains the box-width property, which does what you want - but it's not supported yet.

For more information, search google for "CSS box model".

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 03-05-2004 16:49

Okee Dokes... will adjust widths accordingly...

I'm considering:
a div within a div, where the inner div has width:100% and margin:15px and outer div has the TRUE 700PX width (errr... am trying to simplify my HTML though as I am determined to learn pure CSS web design... no tables)

~Curious~
How many web developers out there avoid <TABLES/> completely?

Karl

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 03-05-2004 18:43

The first question seems to be adequately answered.

The second question: avoiding tables completely is as much bad practice as is relying on them for layout.

Tables have a purpose.

They should be used for that purpose.

THey should not be used simply for layout, and they should not be replaced strictly for the sake of "not using tables".



Cameron
Bipolar (III) Inmate

From: Brisbane
Insane since: Jan 2003

posted posted 03-06-2004 05:03

Agreed. I still use tables for calanders, timetables and similar tabular data.

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

posted posted 03-06-2004 19:51

What ^they^ said. Tables have a distinct and defensible purpose. They have usability features such as summaries and heading tags and such. They continue to be supported because they continue to be important.

Using them for page layout is a corruption of their intent. Before css attained significant support tables were the only option for placing elements. Though there are exceptions to every rule, my opinion is that today css is better for layout (and other presentation purposes) in just about every case.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu