|
|
|
|
![]() ![]() |
Jan 27 2008, 09:26 AM
Post
#1
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 52 Joined: 26-August 07 Member No.: 48,866 |
I want to know how to put an image anywhere in the page using HTML/JavaScript.
Please Help. |
|
|
|
Jan 27 2008, 09:51 AM
Post
#2
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,052 Joined: 28-May 05 From: Hertfordshire, England Member No.: 7,593 ![]() |
To put an image on the page you use the IMG tag:
HTML <img src="path/to/image.png" width="200" height="150" alt="Alternative text if image cannot be displayed" /> src defines the path to the image. Width and height are fairly obvious, measured in pixels. Alt is text which gets displayed if the user has a text-based browser, the image can't be downloaded or anything like that. It is also shown when the user mouses over the image. The image will appear wherever you put that tag. W3Schools have a good guide to using the IMG tag which I advise you read through. To literally position it "anywhere in the page" you'd need to use some CSS to position it where you wanted, most likely using absolute positioning. This page has a quick guide to using CSS, and that link specifically goes to an example of absolutely positioning an image. |
|
|
|
Jan 27 2008, 05:31 PM
Post
#3
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,874 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
You do not need to use absolute positioning, either.
Floats, Margins and Padding can be used to place block-level items on the page. Do you have a page of code for us to look at and assist with your layout problem? If so, post it up. thanks. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 24th July 2008 - 06:30 AM |