Fixed graphic in HTML

  • Thread starter Thread starter J.B
  • Start date Start date

J.B

J.B

Soldato
Joined
16 Aug 2006
Posts
5,924
Ok this is going to be a bit tricky to try and explain, lets say I have a logo for a site in the top right of the page, when the site is viewed on a different resolution machine is there anyway to keep that logo nested at the top right regardless of res.

I guess im after an anamorphic, i'll try and upload it somewhere so people can see, but for now thoughts/suggestions would be good.
 
can be done very easily, you can do it using CSS positioning. something like this

Code:
img.Logo {position:absolute;top;0;right:1px}

that will place the logo in the very top right corner of the browser window. The reason its placed 1px from the right is because if the image is clickable, ie, a link, when the user clicks the image, those dashed border lines appear around it, and cause nasty sideways scroll bars to temporarily appear. Moving the image from the right by 1px, removes these ugly scroll bars.
 
Ok another question, how do I declare the image as Logo, is it the name of the image or the alt text or something else?
 
set the css:

img.logo {
position:absolute 1 1 0 0;
}


and call the reference in the code:

<img class="logo" src"... >
 
Back
Top Bottom