473,420 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,420 software developers and data experts.

css image not moving

cassbiz
202 100+
I am trying to set an image with css and it is not moving

in my css file I have the following line

Expand|Select|Wrap|Line Numbers
  1. .po     {position: absolute; top: 200px; right: 100px;} 
in my php page I have the following line

Expand|Select|Wrap|Line Numbers
  1. echo '<div class="po"><img src="../images/park_map_test.gif" width="575" height="639"></div>';
The image doesn't move. I have googled this subject out and cannot get it to move.

Thanks in advance for any error that I may have.
Nov 12 '06 #1
5 11301
drhowarddrfine
7,435 Expert 4TB
You have the div absolutely positioned which will remove it from the normal flow, so the image winds up being independent of the positioning of the div.
Nov 13 '06 #2
cassbiz
202 100+
You have the div absolutely positioned which will remove it from the normal flow, so the image winds up being independent of the positioning of the div.
Thank you, still being stumped here, how would you recommend the code to be. I will also have to lay text over the top of the image.
Nov 13 '06 #3
drhowarddrfine
7,435 Expert 4TB
What happens is the containing div must be positioned, too. Here's what I used. The image is just one I had on my computer.
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2.    "http://www.w3.org/TR/html4/strict.dtd">
  3. <html>
  4. <head>
  5. <title></title>
  6.  
  7. <style type="text/css">
  8. .po{
  9. position:relative;
  10. border:1px solid red;
  11. height:600px;
  12. width:800px;
  13. }
  14. .po img{
  15. position:absolute;
  16. height:60px;
  17. width:50px;
  18. top:200px;
  19. right:100px;
  20. }
  21.  
  22. </style>
  23. </head>
  24. <body>
  25.  
  26. <div class="po"><img src="Daniel.jpg"></img></div>
  27.  
  28. </body>
  29. </html>
  30.  
Nov 13 '06 #4
cassbiz
202 100+
What happens is the containing div must be positioned, too. Here's what I used. The image is just one I had on my computer.
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2.    "http://www.w3.org/TR/html4/strict.dtd">
  3. <html>
  4. <head>
  5. <title></title>
  6.  
  7. <style type="text/css">
  8. .po{
  9. position:relative;
  10. border:1px solid red;
  11. height:600px;
  12. width:800px;
  13. }
  14. .po img{
  15. position:absolute;
  16. height:60px;
  17. width:50px;
  18. top:200px;
  19. right:100px;
  20. }
  21.  
  22. </style>
  23. </head>
  24. <body>
  25.  
  26. <div class="po"><img src="Daniel.jpg"></img></div>
  27.  
  28. </body>
  29. </html>
  30.  


Dang! You dun did it! :) Thanks

I almost think searching for pirate treasure is easier than writing code.
Nov 13 '06 #5
drhowarddrfine
7,435 Expert 4TB
Arrgh, yer welcome me matey.
Nov 13 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Donjuan | last post by:
Hi all I have trouble with tracking whether my image file is loaded. i use DHTML to change my image. HERE is the code: <img name="someimage" src="1.jpg"...
2
by: upro | last post by:
Hi! I'm totally new to JavaScript, and haven't been able to find the answer to that on the web: I have an image and want to use an imagemap in a way that when the cursor touches a certain...
5
by: Roger Shrubber | last post by:
I have a page with images that the user can drag from one frame to another. I need them to see a "ghost image" of the image they are dragging, while the original stays put. I use the onmousemove...
6
by: David Stone | last post by:
I have a simple question about the alt content of area elements within an image map: is it redundant to include phrases such as "link to..." or "jump to..."? My initial thought is 'yes', since...
10
by: cjparis | last post by:
Hello everyone. If anyone can give me a hand I would be gratefull Am doing a site which requires a moving element and have used DHTML to do it. Have a simple Browser detect script to sort IE...
1
by: rsteph | last post by:
I bought a book to help me learn to use DirectX with windows programming. It's first trying to walk me through some basic windows programming and graphics before getting into DirectX. I'm trying to...
0
by: dazzler | last post by:
I'm trying to draw line to an existing image, the problem is that the image doesn't update/refresh itself. In the example there's one button, but when pressing the button it changes the image but...
3
by: ramesh1210 | last post by:
Hi all, Actually my requirement is to place an image in the text box and it should stand over the data in the text box. And i made it as ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.