SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2010
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    compatible browser

    Hello
    this code is not compatible with google chrome

    element.style {
    position: absolute;
    display: block;
    height: 290px;
    width: 214px;
    top: 9px;
    left: 539px;
    }

    what's the problem?

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,481
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    There is no problem and the code will work fine in all browsers.
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    .test {
        position: absolute;
        /*display: block; not needed but will do no harm*/
        height: 290px;
        width: 214px;
        top: 9px;
        left: 539px;
        background:red;/* for testing only*/
    }
    </style>
    </head>
    <body>
    <div class="test">I work OK</div>
    </body>
    </html>
    It is likely that you were expecting something else to happen or you have other rules conflicting with the above.

    You'll have to provide more information and code and explain what you expected to happen or what is happening in chrome that you think is wrong.

  3. #3
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Paul's being polite... I lack an internal censor...

    1) CSS without the markup it's applied to and the layout it's inside is gibberish. This falls into the "and this is why we can't help you" category.

    2) Position:absolute elements are INHERENTLY display:block, so there's no need to say that again in your code.

    3) Define "doesn't work"?


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
  •