SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London, UK
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question <div> tags in IE vs NN

    Hi all,

    I'm creating my portfolio site & am struggling to find the source of a Netscape problem which is baffling me.

    I've got one main 'content' <div> within which I've nested other <div>'s, & the latter are somehow being forced down the screen to where the content <div> ends. If you're using NN you can see what I mean here.
    The site displays fine in IE, but corrupts in NN6.2.3 (&, I'm sure, in earlier versions as well). Any pointers or ideas gratefully received

  2. #2
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    are you using css or JS?

    <script language="JavaScript" type="text/JavaScript"
    src="stylechanger.js">

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London, UK
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Both - the JS is for the style-changer function, but all the layout is CSS.

  4. #4
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok... i'm no guru but what i see seems odd...

    when i view source in NS 4.77 i see the stylesheet NOT the java script
    <LINK rel="stylesheet" type="text/css" href="august.css">

    when i preview in every other browser I see the JS but NOT the stylesheet
    <script language="JavaScript" type="text/JavaScript" src="stylechanger.js"></script>

    soo... somehow its messed up
    maybe if you re-link your stylesheet & js again such that you can always see them in the source it will work?

  5. #5
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    corrupts in NN6.2.3 (&, I'm sure, in earlier versions as well)
    Note: Netscape 6.x/7 are RADICALLY different from Netscape 4.x and earlier. Completely different (and much improved) rendering engine. For a start, Netscape 4.x can't do CSS for toffee, so if you think N6 trashes the page, you ain't seen nothin' yet.
    when i view source in NS 4.77 i see the stylesheet NOT the java script
    <LINK rel="stylesheet" type="text/css" href="august.css">
    when i preview in every other browser I see the JS but NOT the stylesheet
    <script language="JavaScript" type="text/JavaScript" src="stylechanger.js"></script>
    By default, NN4.x shows the GENERATED source, i.e. the output from any javascript document.write() calls, NOT the source as downloaded from the server. This is a Good Thing... from a certain point of view.

    Re: the site:

    In mozilla (Netscape 6/7's open-source sibling), the style change div is busted, mostly, I think, by this sytactical glitch:
    Code:
    div#stylechange {{ (etc.)
    Note the two "{" characters.

    Apart from that, and the IE-centric coloured scrollbar, everything looks fine in Moz.

  6. #6
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by blufive


    By default, NN4.x shows the GENERATED source, i.e. the output from any javascript document.write() calls, NOT the source as downloaded from the server. This is a Good Thing... from a certain point of view.

    ok.
    how come then, you cannot see the link for the stylesheet in the rest of the browsers?

  7. #7
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London, UK
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your input, ktown & blufive.

    The
    Code:
    div#stylechange {{
    has been fixed & it's sorted out the stylechanger problem, but the main problem - i.e. nested <div>s being forced out of their parent <div> - remains. Works fine in IE/Mozilla, so it must be a NN-specific problem?

  8. #8
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Netscape 6.2.x is based on Mozilla 0.9.4. So, since it seems to work in Mozilla 1.0/1.1, I'd guess that this was a bug that got fixed in the intervening months. Therefore it ought to work in Netscape 7, too.

    how come then, you cannot see the link for the stylesheet in the rest of the browsers?
    The stylesheer link is generated source: it's output by the javascript, but doesn't exist in the raw source code. This is why it's sometimes useful to see generated source rather than raw source.

    BTW: It might be worth putting a default stylesheet link in a noscript tag, otherwise people with JS turned off will get an unstyled mess.

  9. #9
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by blufive
    The stylesheer link is generated source: it's output by the javascript, but doesn't exist in the raw source code. This is why it's sometimes useful to see generated source rather than raw source.
    thanks
    you're full of usefull information!
    this is very good to know.

  10. #10
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    London, UK
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found a solution

    If you're interested, it's a bit of a hack, but I added the following extra <div> in the stylesheet:
    Code:
    div#NNcontent {position: relative; top: 1px; left: 1px; right: 1px; padding:0px; border: 0px; margin: 0px;}
    & inserted it between the 'parent' <div> & the first 'child' <div>....
    I really don't know why Netscape (6.2.3) needs it - maybe it's a bug???


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •