HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
How to keep image in same place when resizing browser
Post new topic   Reply to topic    HTML Help Forum -> Images & Graphics
View previous topic :: View next topic  
Author Message
madbrit



Joined: 12 Apr 2008
Posts: 2

PostPosted: Sat Apr 12, 2008 1:11 pm     How to keep image in same place when resizing browser Reply with quote

Hi to all, new HTML so please forgive me if this is a stupid question.....

I have a created a web page, on the home page I have 2 images as per the code below. when i click on the image it goes to another web page. I have used Index to be able to move the images where i want BUT......

When i resize the page the images stay as they were and do not rescale with the page and go off to one side.

How can I correct this.


<html>
<body>

<div style=" position: absolute;width: 100px; height: 100px; z-index: 2; left: 250px; top:150px" id="layer2">
<a href="http://www.orcd.pwp.blueyonder.co.uk/en-gb/dept_11.html">
<img border="0" src="http://orcd.pwp.blueyonder.co.uk/Animations/ANDANIMATE.gif" width="150" height="50" align="left"></a></div>

<p>
&nbsp; </p>
<div style="position: absolute; width: 100px; height: 100px; z-index: 1; left: 800px; top: 150px" id="layer1">
<a href="http://www.orcd.pwp.blueyonder.co.uk/en-gb/dept_12.html">
<img border="0" src="http://orcd.pwp.blueyonder.co.uk/Animations/INTELANIMATE.gif" width="150" height="50"></a></div>

</body>

</html>

Thanks

MaDbRiT
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8748
Location: Castle Pines North, CO USA

PostPosted: Sat Apr 12, 2008 2:15 pm     Reply with quote

Well your image is 150 pixels wide. And you are specifically telling the browser to place the "layers" (<div>) in a certain place.

So it seems that it starts over 150 pixels and then another 150 pixels. That's 300 - if the window is smaller than that, then you would have the scrolling bars.

_________________
Corey
Payment Processing Forums | Mile High Merchant Accounts | Microsoft Expression Web Blog
madbrit



Joined: 12 Apr 2008
Posts: 2

PostPosted: Sun Apr 13, 2008 6:29 am     Reply with quote

Ok I see that, thanks, so is there a better way of doing this, if i dont use <div> i cant get them where i want them??

Thanks

MaDBrIt
Straystudio



Joined: 14 Apr 2008
Posts: 297
Location: Nord Italy

PostPosted: Mon Apr 14, 2008 7:49 am     Reply with quote

Hi from Italy!
Change it into something like this:

<div style=" position: absolute; ... left: 20%; top:150px" id="layer2">

<div style="position: absolute; ... right: 30%; top: 150px" id="layer1">

NN9 and IE7 tested.
With these % values, it looks nearly the same as Your version in pixel, on 1280px wide screen.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> Images & Graphics All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial