Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Position on Web Page

by user2000 (Sexton)
on Aug 19, 2007 at 06:45 UTC ( #633562=perlquestion: print w/replies, xml ) Need Help??

user2000 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am trying to achieve the following: I am using a layer (which has an image with an arrow) to point out on a certain part of my webpage. Now the problem is that some of my webpages are center aligned, while some are left aligned. So when i point out to a part of the page, it appears different in different browser windows (depending on the resolution of the window). I am using absolute position of the layer. Is there a way to ensure that for both left as well as center align, if I put a pointing image near a particular word, it remains there for all resolutions irrespective of the alignment of the page? Thank you very much, Anant

Replies are listed 'Best First'.
Re: Position on Web Page
by ikegami (Pope) on Aug 19, 2007 at 07:16 UTC

    Sorry, but this isn't a HTML or CSS help site. Furthermore, if you were looking for a Perl solution, you're outta luck since most clients are unable to execute Perl scripts. CGI scripts run on the server, so they don't have access to the information needed to determine the position of content on the client machine's window. (JavaScript might...)

    I must wonder why you are asking how to use *absolute* positioning to place an item *relative* to another. Is CSS that limited or CSS support that broken?

Re: Position on Web Page
by Gavin (Bishop) on Aug 19, 2007 at 10:24 UTC
    As pointed out by ikegami this is not a Perl question, but could you not position using a % rather than absolute, then the position would be the same regardless of window size.
Re: Position on Web Page
by Gangabass (Vicar) on Aug 19, 2007 at 12:52 UTC

    I think you are going wrong way.

    Different windows could't have different resolutions. Or maybe you're talking about different clients?

    And i'm sure there is the way to achieve this behavior -- CSS

      I believe he meant different sizes.

      Notice how the position of the key item changes in the following two "browser windows":
      foo foo foo foo foo keyword foo foo foo
      foo foo foo foo foo keyword foo foo foo

        So to use your example the arrow is attached to the "keyword" but because of formatting the word position changes with window size.
        Then perhaps one way would be to combine text and "arrow pointer" into an image and display that in the browser

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://633562]
Approved by ikegami
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2020-08-06 07:25 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (39 votes). Check out past polls.