Results 1 to 2 of 2

Thread: DIV tag position question

  1. #1
    hhpracing Guest

    DIV tag position question

    I currently have code that is displaying a popup when I click on an image. I have it set to top 5% left 10% but the problem I am having is I want it to display at top 5% left 10% at the current page x y coordinates that I am at, instead of at the very top of the page.

    Right now say I am in a shopping cart with several lines and I have scrolled down near the bottom of the page. When I click on image instead of display popup where I am it is at very top and unless I scroll back up I never see popup.

    Here is the current code I have in place.
    <div id="HelpWindow" style=" position:absolute; z-index:1000;width: 90%;
    height: 90%;
    margin: 1px auto;

    padding: 2px;
    text-align: center; display: none; top:5%; left:10%;"

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    The div has position: absolute; so you should be able to position it with top: ??px; left:??px; instead of % and it will either take the top and left positions from the top left corner of the window or the top left corner of any parent container that has position: relative;

    You may have to edit the height to px as well.
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. Role of Meta Title Tag in SEO
    By seotips in forum Search Engine Optimization and Marketing
    Replies: 1
    Last Post: 04 Mar 2009, 02:57 AM
  2. Template prob with DIV tag?
    By laksh_khamesra in forum General Questions
    Replies: 1
    Last Post: 30 Apr 2008, 11:26 AM
  3. DIV tag position in CSS
    By yunakokimama in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 28 Jan 2007, 01:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •