Forum Moderators: open

Message Too Old, No Replies

Unnecessary (?) <div> tags

Re-doing a year-old site, can't remember why I added some of this stuff

         

MatthewHSE

4:09 pm on Dec 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm doing a major re-design of a site that I last worked on about a year ago. I'm finding lots of <div style="width: 100%;"> tags that don't seem necessary to me, but I know I knew enough a year ago that I wouldn't have added those tags without a reason.

They're all enclosing tables that were set (with CSS) to be 100% width. It's a CSS-based layout. I seem to remember IE5 doing funny things with 100% tables that a 100% div fixed, but I can't seem to duplicate it now or even remember any details.

So does anyone know why I may have thought those extra div's were necessary or advisable? I know there was a reason - now I just need to decide if the reason is still good enough to leave the things in! ;)

Thanks,

Matthew

tedster

4:31 pm on Dec 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I used to do this (enclose tables in divs) to get NS4 to behave in some cases -- if I remember correctly, some inheritance factors were completely broken for tables unless they were nested in a div.

One of the things I've been lousy at is leaving myself notes when I do some kludge based on a specific browser. Recently there were some Safari work-arounds that I accidentally removed because I couldn't remember why I wrote that goofy code -- only to have complaints come rolling in soon after I changed things.

moltar

4:42 pm on Dec 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think sometimes it can be used to push out the floats. Though
<div>
is 100% width by default. I like to use
<hr />
for cases like that (where makes sense semantically).