Re: Position image x,y in html



"Nik Coughlin" <nrkn.com@xxxxxxxxx> wrote in message news:hcvl58$446$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"Ben C" <spamspam@xxxxxxxxx> wrote in message news:slrnhf6ge2.326.spamspam@xxxxxxxxxxxxxxxxxxxx
On 2009-11-04, Nik Coughlin <nrkn.com@xxxxxxxxx> wrote:

<!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>

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 :)

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">

.



Relevant Pages

  • Re: speed issues traversing the DOM.
    ... The absolute positioning is only when all other solutions fall down. ... leave the JS to complete from Json array each flyout on demand ... To use DW you have to know, at least well, the HTML and CSS, if not that's the soft which decides for you or run you in errors (as absolute that is the default feature proposed by DW). ...
    (comp.lang.javascript)
  • Re: Layout basics
    ... What I'm not sure about is if you're at all familiar with HTML ... display in those browsers. ... IE7, which has been delayed for entirely too long, we have an "absolute ... Because Windows Forms use "absolute positioning" in a Form interface, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Layout basics
    ... HTML browser user interface. ... formatting display in those browsers. ... we have an "absolute nightmare" involved in doing layout that looks more ... Because Windows Forms use "absolute positioning" in a Form interface, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to create relative file paths. We may need to encrypt the
    ... > paths between files and folders. ... > Here are their absolute path names: ... If it is an HTML file, you use HTML syntax to write the references, either ... What is the filetype of File1? ...
    (microsoft.public.windowsxp.newusers)
  • Re: Reading the source of a HTML file, which is displayed by a webbrowser control
    ... Then just refer to them in your generated HTML with absolute (as opposed ... Absolute links have the great disadvantage that you can't use them if you ... Your commitment seems to make and break the newsgroup(It's a figure of ... commitments is the spirit of the newsgroup, but if you don't post, the ...
    (microsoft.public.vc.atl)