Position image x,y in html

G

Geir

Hi,

We have a monitoring page on a specific computer where we need some
differently sized images accurately positioned. Hence there is no
compatibility issues. One computer, one browser.

How do we place imageA.gif at x=500 Y=200? (from the upper left corner
of the screen) At its native pixel size.

Thanks for tips on this

regards

geir
 
A

Adrienne Boswell

Hi,

We have a monitoring page on a specific computer where we need some
differently sized images accurately positioned. Hence there is no
compatibility issues. One computer, one browser.

How do we place imageA.gif at x=500 Y=200? (from the upper left corner
of the screen) At its native pixel size.

Thanks for tips on this

regards

geir

Look at the CSS position property.
 
N

Nik Coughlin

Geir said:
Hi,

We have a monitoring page on a specific computer where we need some
differently sized images accurately positioned. Hence there is no
compatibility issues. One computer, one browser.

How do we place imageA.gif at x=500 Y=200? (from the upper left corner of
the screen) At its native pixel size.

Thanks for tips on this

<!DOCTYPE HTML>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Position imageA</title>
<style type="text/css">
.imageA {
position: absolute;
left: 500px;
top: 200px;
}
</style>
</head>
<body>
<img src="imageA.gif" class="imageA" alt="meaningful alt text">
</body>
</html>
 
N

Nik Coughlin

Ben C said:
Yes, although this is invalid-- not supposed to have an IMG just inside
BODY like that. Put a DIV around it.

Nope, perfectly valid, look at the doctype. But your advice is good for the
OP who is probably not authoring as HTML 5 :)
 
N

Nik Coughlin

Nik Coughlin said:
Nope, perfectly valid, look at the doctype. But your advice is good for
the OP who is probably not authoring as HTML 5 :)

In fact, this is valid HTML5 (provided that the server is sending character
encoding or the file has a Unicode BOM):

<!DOCTYPE HTML>
<title>Position imageA</title>
<style type="text/css">
.imageA {
position: absolute;
left: 500px;
top: 200px;
}
</style>
<img src="bigger.png" class="imageA" alt="meantingful alt text">
 
T

Travis Newbury

...Hence there is no
compatibility issues.  One computer, one browser.
How do we place imageA.gif at x=500 Y=200? (from the upper left corner
of the screen)  At its native pixel size.


Does anyone "really" believe this is running this on a single system
with a single browser? Come on... They just know everyone will give
them crap about trying to make it look exactly like they want if they
did not put that in there...

That said, I think it is perfectly all right to have such a page and
they should look at CSS absolute positioning....
 
B

Beauregard T. Shagnasty

Ben said:
I was curious about the doctype. So that's an HTML 5 doctype?

Sending Nik's sample to the validator produces this:

" Using experimental feature: HTML5 Conformance Checker.

The validator checked your document with an experimental feature: HTML5
Conformance Checker. This feature has been made available for your
convenience, but be aware that it may be unreliable, or not perfectly up
to date with the latest development of some cutting-edge technologies."

Personally, I wouldn't use HTML5 until it is listed here:
http://www.w3.org/QA/2002/04/valid-dtd-list.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top