Forum Moderators: not2easy
wich is a plain HTML syntax, I can easely position my image using this code:
<DIV ID="image1" STYLE="position:absolute; top:125; left:0;">
<IMG SRC="image.gif" BORDER="0" alt="blablabla" width="20" height="20">
</DIV>
If I begin the file with this:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
I really don't get the same results for the same img code. What to do?
If that doesn't work try validating the page. This should always be done anyway - it shows up all sorts of problems.
Another point is that XHTML is case sensitive, and the recommendation is to use lower case for tags and attributes.
also width="20" should be width="20px" etc
No, it should just be width="20". CSS requires a unit of measurement but HTML always uses pixels unless you specify it as a percentage.
See [w3.org...] for the W3C DTD definition of length in HTML.
<!ENTITY % Length "CDATA">
<!-- nn for pixels or nn% for percentage length -->
As I mentioned before it would be worthwhile validating your pages. For instance, I have just noticed something else in your code that is invalid in XHTML.
Your <IMG SRC="image.gif" BORDER="0" alt="blablabla" width="20" height="20"> should end height="20" /> (with a space between the "20" and the /> ). All tags have to be closed. For instance a <br> tag must be written <br />, and a <p> tag must be followed by a </p> tag, etc.
All this stuff is actually very simple and an easy habit to get into. One advantage is that a page written in valid XHTML will also work as HTML.