473,503 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

css image not moving

cassbiz
202 New Member
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 11327
drhowarddrfine
7,435 Recognized Expert Expert
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 New Member
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 Recognized Expert Expert
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 New Member
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 Recognized Expert Expert
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
6169
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
3150
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
3033
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
4731
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
6735
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
3778
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
4201
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
2849
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
7199
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
7076
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
7323
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
6984
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
7453
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
5576
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
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.