Results 1 to 2 of 2

Thread: Fixed and Absolute Position in CSS

  1. #1
    Join Date
    Aug 2007
    Posts
    2

    Fixed and Absolute Position in CSS

    hello, I've tried all three DTDs but the code for selecting absolute or fixed position with CSS ONLY works for me (in Safari and in Firefox) when I don't have a DTD declared on the page.

    as it stands, there is no DTD. here's the address:

    http://www.columbia.edu/cu/skiteam/home.html

    thanks so much.

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    I first added the HTML strict Doctype because all pages should have one and both IE7 and Firefox displayed the same, which is a good sign.

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">

    I then added px to the positions and all images went where they should be:-

    <style type="text/css">
    #layer1 {position:fixed; left:125px;top:10px; z-Index:0}
    </style>

    <style type="text/css">
    #layer2 {position:fixed; left:150px;top:15px; z-Index:0}
    </style>

    <style type="text/css">
    #layer3 {position:fixed; left:350px;top:415px; z-Index:3}
    </style>

    But you need to check IE6 which doesn't support position: fixed but may use position: absolute instead with the same result (but I haven't tested).
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. DIV tag position in CSS
    By yunakokimama in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 28 Jan 2007, 01:59 AM

Posting Permissions

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