Donate SIGN UP

html trouble

Avatar Image
sykosat2004 | 16:57 Tue 26th Jul 2005 | Technology
6 Answers

when writing in html how do you know where the picture will be placed. do u need to use coordinates or something? thanks a lot

Gravatar

Answers

1 to 6 of 6rss feed

Best Answer

No best answer has yet been selected by sykosat2004. Once a best answer has been selected, it will be shown here.

For more on marking an answer as the "Best Answer", please visit our FAQ.
It will be placed just as text would - html starts working at the top of the page and works down, starting a new line each time you either tell it to, like a word document.
IF you want to place it somewhere else, put it in a cell in a table and fiddle about with the column widths of the table until it looks right
chazza, thats an old and out-dated technique, and (imo, and many others), very bad.

images are whats known as inline elements. this means that if you just add an image in some text, it will appear in that line of text, not on a new line
like this text here.

to make it appear on a new line, use:

text..




<img src="">


text..



or for the odd image, make it display as a block element (a block element is one that is put on its own line, like a new paragraph of text (this is block by default):

<img src="" style="display: block">

where the display:block stuff is called CSS, or Cascading Style Sheet.
oops, it removed the HTML i typed. oh well:

< p > blah < / p >

< br >

< img src="" >

< p > blah < / p >
fo3nix, i'm not sure i understand your method, could you explain it again?  I would be interested in trying that method but can't follow your explanation!
sorry.

normally, if you just place an image somewhere, it will be placed automatically by the browser somewhere. an image is an HTML tag thats known as being an "inline" tag, which means that the browser doesn't automatically put it on a new line of text to accomodate it.

if you want it on a new line, you could set it like so:
< img src="" style="display: block">

this is some CSS, that will set the image to become a block-level element, instead of an inline element. this means that it'll get put on a new line if it's, say, within a paragraph of text.

for positioning precisely, you do it with CSS too:

http://www.w3schools.com/css/css_positioning.asp

so you could write:

< img src="" style="float: right">
to make it float to the right

or

< img src="" style="position:absolute;top:0px;left:0px">
that'll make it appear at the top left of the screen. the absolute position means to take it out of the normal page order. if you want it like normal, you can set the position to relative, etc.

Basically, you can acheive image location by using CSS. see the above link [w3schools] for some decent tutorials :)

1 to 6 of 6rss feed

Do you know the answer?

html trouble

Answer Question >>