SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Location
    Ontario, Canada
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Absolutely positioned

    Hey all,

    If an element is absolutely positioned using coordinates, is using float (right/left) redundant, and what effect would this have if any?

    nassehma.

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Basically, the float property is ignored on absolutely positioned elements. (More info.)
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    With absolutely positioned elements that are defined inside of relatively defined elements the top and left positions relative to that relatively defined element determine how the two elements overlap.

    With absolutely positioned elements defined separately the top and left positions updated from JavaScript determine how that element moves around the page.

    For absolutely positioned elements defined any other way the element will be positioned incorrectly if the browser window is not opened to exactly the size that it has been defined for. To fix this you get rid of the position:absolute and use float instead.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Location
    Ontario, Canada
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Guys I appreciate the feedback.

    nassehma.


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
  •