SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2012
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    positioning of div

    Hi, I'm trying to get a div to display within the header in a certain position and not move around when someone re sizes their web browser. I'm using position:absolute, when I try relative it doesn't work and expands the widget's height for some reason and I think I have it nested inside of the header and the weather class div but the header isn't a div. it's html 5 tag so maybe that is the reason why the widget-currentscompact div moves around and doesn't stay put?

    Here's some of the code.

    #widget-currentscompact {
    width:120px;
    height:50px;
    position:absolute;
    top:52px;
    right:200px
    }

    Here's the url for the webpage: http://69.65.18.90/lasallestreetnews.com/

    Thank you!

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,317
    Mentioned
    461 Post(s)
    Tagged
    8 Thread(s)
    All you need is this:

    Code:
    header {position: relative;}
    That will position the widget in relation to the header, rather than in relation to the viewport.

  3. #3
    SitePoint Member
    Join Date
    Jun 2012
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that worked, thank you.......


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
  •