#1
  1. No Profile Picture
    Absent-Minded Professor
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Plano, TX
    Posts
    70
    Rep Power
    12

    Red face Netscape and the way it parses CSS


    In the unending search to make my website cross-browser compatible, I found out that Netscape doesn't parse the width attribute in CSS. I thought maybe it was because I was using it within an a tag, but it also doesn't work with span div or anything else I try to apply it to ... I was wondering if there's a workaround for this so that people who use Netscape, God have mercy on them, can view it properly.

    Thanks in advance.
    Numb from all the things I've never heard.
  2. #2
  3. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    since you don't show any code its hard to help,
    but as for the span-tag, you normaly can't set width to inline elements, so widths applied to such elements should be ignored.
    http://www.w3.org/TR/html4/struct/global.html#h-7.5.3


    and always remeber to set a length unit, like em, %, px etc.
    http://www.w3.org/TR/CSS2/syndata.html#length-units

    ie.

    .test { width:50%; }

    <div class="test"> test</div>
  4. #3
  5. No Profile Picture
    Absent-Minded Professor
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Plano, TX
    Posts
    70
    Rep Power
    12
    I figured it out ... this is what my end code looks like ...

    PHP Code:
            <style>
    body    {
        
    fontnormal 8pt Verdanasans-serif !important;
        }
    .
    entry    {
        
    displayblock;
        
    font-size10pt;
        
    width500px;
        
    text-alignjustify;
        }
    .
    entry SPAN.title    {
                
    displayblock;
                
    font-size125%;
                
    width500px;
                
    padding3px;
                
    border-bottom1px solid #000000;
                
    }
    .
    entry P:first-letter    {
                
    font-size125%;
                }
    OL    {
        
    counter-resetitem;
        }
    LI    {
        
    displayblock;
        }
    LI:before    {
            
    contentcounter(item". ";
            
    counter-incrementitem;
            }
            </
    style
    I just had to set display: block; ... It's always something easy.
    Numb from all the things I've never heard.
  6. #4
  7. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    instead of a the span tag, you should use an appropriate h-tag.
    as <span class="title"> doesn't have any semantical meaning.

    and even though you can overrule a elements setting, ie set display:block on a inline element, you are encouraged not to.


    you could aslo remove
    LI {

    display: block;

    }

    as li is block-level elements.
  8. #5
  9. No Profile Picture
    Absent-Minded Professor
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Plano, TX
    Posts
    70
    Rep Power
    12
    For some reason NS won't treat the LI as a block box, IE does it without the extra line, but NS is a sucky browser and parses stuff differently.

    I'm anti-netscape.

    But the thought never even crossed my mind to use the H tag. Any other suggestions as far as usage of tags goes?
    Numb from all the things I've never heard.
  10. #6
  11. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    there might be, but as i don't see the rest of the code i can't say what

    though you should be aware of setting an explicit font-size, it might cause problems for some users, instead of pt (which has little meaning on a screen) you should be using em or %,

    you should aslo be aware using verdana,
    it might be rendred differently on the drifferent browser/system
    http://www.xs4all.nl/~sbpoley/webmatters/verdana.html


    and ns/mozilla is not a sucky browser,
    if you have been doing css for a while you understand that it is very good browser.

    Comments on this post

    • JohJoh agrees : I understand now the errors of my ways. NS is truly not a sucky browser.

IMN logo majestic logo threadwatch logo seochat tools logo