SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Jan 2001
    Location
    Ottawa ON
    Posts
    315
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Internet Explorer/Netscape6 Issue: How do I get them both to support the same code?

    Here's what I want to do:
    Turn this frame-based layout into a single HTML page.

    Here's what I have done:
    • Produced this page which captures the basic layout in HTML using DIVs and CSS. It works in Mozilla 0.9.7.
    • Produced this page which captures the basic layout in HTML using tables and DIVs and CSS. It works in Internet Explorer 6.


    The first page uses the standards-complaint approach - the way things are "supposed" to work. However, Internet Explorer/Win doesn't support the position:fixed attribute of CSS, so that design can't work (if you know of a way of getting the first design to work in IE without having to use javascript, please let me know - I'd prefer to just be able to use DIVs).

    Because I couldn't get the first design to work in IE, I created the second table-based design. However, I can't get it to work in Netscape.

    Here's the exact problem that I'm having:
    In this file http://radio.weblogs.com/0100725/gem...d%20Tables.htm the <div> with id="mainContent" has the following CSS attributes (inline): style="background:green;width:100%;height:100%;overflow:auto;"

    With those style properties, the <div> doesn't display at all in Mozilla! If I remove the width:100%;height:100%;overflow:auto; then the <div> (and it's contents) are visible.

    This is the desired behaviour:
    The "mainContent" section of the page would render exactly the same in Netscape as it does in Internet Explorer.

    Note:
    Opera doesn't work properly with either layout, and because so few people use that browser, I'm just going to ignore it.

    If you have any questions, please email me or ICQ me: 67112112. Any help is very much apprecaited!

  2. #2
    SitePoint Guru jkcity's Avatar
    Join Date
    May 2001
    Location
    England
    Posts
    746
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No answer to your question sorry but:

    "Opera doesn't work properly with either layout, and because so few people use that browser, I'm just going to ignore it."

    May not be true, The only people who knwo how many opera users there are are opera as it disguises itself as internet explorer by default, So I don't think you should just ignore it.

  3. #3
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, if something works in opera, it's very, very likely to work in NS and IE.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  4. #4
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Internet Explorer/Netscape6 Issue: How do I get them both to support the same code?

    Originally posted by prowsej
    However, Internet Explorer/Win doesn't support the position:fixed attribute of CSS,
    use position:absolute
    even ns 4+ supports it. Absolute is just a subset of fixed. Only difference is, you have to keep in mind what the containing block is for absolute.

    be sure and validate your css and html if you are having different problems in all 3 browsers.

    design for opera and ns 6.2, they are the most standard compliant, then deal with ie.

    stevo

  5. #5
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Re: Internet Explorer/Netscape6 Issue: How do I get them both to support the same code?

    Originally posted by Stevo
    design for opera and ns 6.2, they are the most standard compliant, then deal with ie.stevo
    hehehe, actually, i'd be doing the oposite, IE is by far the most used browser, design for that, then worry about the others and dont forget you can use a serverside language to dish out the right page for the right browser if worst comes to worst (ok, its cheating ).

    Does opera really disguise itself as IE? becuase an aweful lot of stats. programs show up opera...

  6. #6
    SitePoint Wizard iTec's Avatar
    Join Date
    May 2001
    Location
    Sydney, Australia
    Posts
    2,243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Re: Re: Internet Explorer/Netscape6 Issue: How do I get them both to support the same code?

    Originally posted by platinum
    (ok, its cheating ).
    no its not, its using all the resources available, tho having 3 different versions of a page would be a bit of a nightmare.

  7. #7
    SitePoint Addict
    Join Date
    Jan 2001
    Location
    Ottawa ON
    Posts
    315
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Re: Internet Explorer/Netscape6 Issue: How do I get them both to support the same code?

    Originally posted by Stevo


    use position:absolute
    even ns 4+ supports it. Absolute is just a subset of fixed. Only difference is, you have to keep in mind what the containing block is for absolute.

    be sure and validate your css and html if you are having different problems in all 3 browsers.

    position:fixed and position:absolute are totally different things. I need fixed and not absolute. What I'm trying to do is impossible with absolute.

    I want a div on the left hand side of the page and then a div next to it that automatically scales to take up the rest of the room. AFAIK, that's impossible using absolute (without getting into javascript, of course)

    design for opera and ns 6.2, they are the most standard compliant, then deal with ie.
    That's what I did. My page works in Netscape. But the way that you make that page work in Netscape just will not work in IE. So now I'm dealing with IE and I've run into a specific problem and I'm asking people for help.
    Last edited by prowsej; Jan 25, 2002 at 11:30.

  8. #8
    SitePoint Addict
    Join Date
    Jan 2001
    Location
    Ottawa ON
    Posts
    315
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by jkcity
    May not be true, The only people who knwo how many opera users there are are opera as it disguises itself as internet explorer by default, So I don't think you should just ignore it.
    Annecdotally, I don't know anybody who uses Opera. I've produced standards-compliant code that works in Netscape6. Opera doesn't support it (it doesn't have perfect CSS2 support). And I'm not interested in fiddling around with the site to cater to < 1% of my users (because this is a personal site). If it were for a company/organization, of course I'd get the site working well in Opera.

    But for personal, site I'll write standards-compliant code and then say "take it or leave it, Opera"

  9. #9
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fixed postitioning

    prowsej, I am just a little confused.

    You say you want to reproduce a frames based layout, which is rightly usually done with fixed positioning, but you want to do it with IE which does not support fixed positioning. It sounds to me like you are banging you're head against the M$ wall. There are some hacks for IE that will allow you to do that, just do a google groups search on fixed positioning. I believe they were all in the comp.infosystems.www.authoring.stylesheets group.

    According to w3org, 9.6.1, "Fixed positioning is a sub category of absolute positioning.." sorry I had that backwards in my previous post. Absolute is fixing a position inside some container (body, other div, etc) and fixed is just designating the container as the view port. (or the printed page if you designate print media). Most people use fixed positioning so that something always stays on the screen, but it is not used much, because as you know, IE with 95% browser share does not support it.

    supposedly Netscape 6.2 has added fixed to its reportoire.
    there is an example of fixed positioning in the standards Fixed position example

    The reason I suggested absolute is because your IE does not support fixed and if all you want is a div on the left side and a div next to it that takes up the rest of the page that can be done with absolute or relative positioning.

    good luck

    stevo

    p.s. always use % with fixed positioning, because you do not know the size of the users viewport. (unless you want to do some more scripting)

    Here is one hack from google
    message 5
    Last edited by Stevo; Jan 26, 2002 at 18:21.

  10. #10
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Location
    UK
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can your problem be solved with by setting the second div to use a width of "*"? In frames, this makes the frame stretch to fill the remaining space.

    Eg: first frame = 25%
    second frame = *
    Result = 75%

    Useful when resizing the browser window, but not sure if it works with divs or not.


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
  •