简体   繁体   中英

positioning an image on an HTML page

Total noob to HTML, So this is probably a really simple solution.

I'm trying to place a gif image at the center and bottom of a web page. Of course this doesn't happen.

<img src="http://bglradio.net/sam/Web-Images/dancing-girl-6.gif" alt="Dancing Girl" width="160" height="250">

What (If anything) do I need to add to this line to place the image anywhere along its line?

Thanks in advance Steve

Positioning elements on a page is much easier with CSS. If you're not already comfortable or at least familiar with CSS, I would strongly suggest you go out and find a few of the many, many tutorials out there.

To the best of my knowledge, doing this:

<img src="http://bglradio.net/sam/Web-Images/dancing-girl-6.gif" alt="Dancing Girl" width="160" height="250" style="left: 50%; position: fixed; bottom: 0px; margin-left: -80px">

should center the image perfectly an anchor it to the bottom of the page. That is quite a bit of CSS if you're a noob which is why I say again, make sure you start learning CSS.

Hope this helps.

add class to the image to call it through some css like here 

<!DOCTYPE html>
<html>
<head>
<style>

.dancing {
position: absolute;
right: 0px;
bottom: 0px;

}
</style>
</head>
<body><img class="dancing" src="http://bglradio.net/sam/Web-Images/dancing-girl-6.gif" alt="Dancing Girl" width="160" height="250" align="bottom"  >

</body>

</html>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM