473,651 Members | 2,635 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 11423
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
6190
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" onclick="document.all.someimage.src='someimage.jpg"> but how can i determine whether "someimage.jpg" is loaded? and can i get the download percent of a file? Thanks in advance
2
3156
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 point there's some text (possibly moving/scrolling) displayed on/over the image. In concrtene: I have a face, and when touching the eye with the cursor
5
3037
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 event to keep the ghost image under the mouse pointer. There are three problems: (1) if the ghost image is dragged so it is partially off the edge of the screen, scrollbars appear. This not only looks bad, it can cause the page to autoscroll...
6
4744
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 the area element implies a link to some other item or page location, but would like to hear what others think. If it helps at all, the page which prompted me to ask the question is this one: ...
10
6766
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 from Netscape. IE is ok but the Netscape browser including Firefox and Safari are not working now. Not sure why. The idea is that when you mouseover the arrows the gallery div moves to left and right. I have changed the script and now the image...
1
3792
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 expand on one of the example programs in the book but I'm having some problems. I can get a frame to appear, then an image gets randomly placed in the box. It is suppose to move right, then when it hits the edge move left; it should repeate this...
0
4221
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 the image doesn't show up, and if I move other windows over my application window it will then refresh my application window and reveals the image. so what I'm trying to do is animating (moving) a line over existing image also, I don't want to...
3
2851
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 ------------------------------------------------------------------------------------------ <html> <head> <style> .formlabel
0
8795
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8460
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8576
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6157
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4143
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.