Results 1 to 6 of 6

Thread: DIV position permanent, please help.

  1. #1
    Join Date
    Jan 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DIV position permanent, please help.

    Hey guys,

    I have a question about a DIV;

    Code:
    <div id="apDiv3"><img src="Images/Logo.png" width="248" height="248" alt="** PLEASE DESCRIBE THIS IMAGE **" /></div>
    You can see it on this page:

    http://www.chemicaldesigns.org/Clien...ng/markup.html

    I want to position the DIV to basically stay in the same place on the page. I am guessing it's quite easy to do but need some help from someone who knows the score.

    Thanks a lot!

  2. #2
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    use position: fixed;
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  3. #3
    Join Date
    Jan 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi, I tried that but then it just stays in the same place but as soon as the browser resizes the logo moves. I want it to stay in the same place even if the browser is resized, would you know how I do this?

    Thanks.

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    do you mean that you want it to stay a certain distance from the top left? You're using a percentage to define it's position now:
    Code:
    #apDiv3 {
            position:absolute;
            width:130px;
            height:115px;
            z-index:99;
            left: 5%;
            top: 6%;
            }
    Use pixel measurements and change the position to "fixed", something like this:
    Code:
    #apDiv3 {
            position:fixed;
            left:30px;
            top:36px;
            }

  5. #5
    Join Date
    Jan 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hey, thanks for the help, but basically that does the same thing as percentage. I want it to stay in the same place because of different screen resolutions, is there a way I can position it from the center rather than the top left?

    Thanks,

  6. #6
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    It's not the same as a percentage: for example, 5% left on a 800x600 screen is 40 pixels from the left, but on a 1440x900 screen, it's 72.

    I think what I don't understand is what you mean by "the same place". Do you want it to always be a certain distance from the center column (where your main content is)?

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
  •