Results 1 to 2 of 2

Thread: div position absolute with xhtml1-strict.dtd doctype

  1. #1
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Default div position absolute with xhtml1-strict.dtd doctype

    I have this doctype(cannot change it):
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    I have this script:
    <script>
    function showd(element) {
    var el = document.getElementById(element);
    el.style.display = "block";
    }

    function closeContentD(element) {
    var el = document.getElementById(element);
    el.style.display = "none";
    }
    </script>

    this css for the DIV that has to appear when I click on link:
    .div_funnel{position:relative;
    visibility:visible;
    width:340px;
    height:320px;
    top:70;left:200;
    z-index:100;
    }

    when I call for the DIV <a href="#" onclick="showd('funnelDIV')">LINK</a>)
    the position ofthe div is not according to its css (top:70;left:200

    this is due to doctype.
    How can I fix it without changing the doctype?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You shouldn't be using XHTML, but that has nothing to do with this problem. Any valid URL DOCTYPE would cause this, including the recommended valid URL DOCTYPE (HTML 4.01 strict). The problem arises, at least in part, because with a valid URL DTD of this sort, units must be specified for both locations and dimensions. So add them:

    Code:
    .div_funnel {
    position:relative;
    visibility:visible;
    width:340px;
    height:320px;
    top:70px;
    left:200px;
    z-index:100;
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    emanuelle (05-15-2008)

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
  •