[英]positioning an image on an HTML page
对HTML完全没有知识,所以这可能是一个非常简单的解决方案。
我试图将gif图像放置在网页的中心和底部。 当然这不会发生。
<img src="http://bglradio.net/sam/Web-Images/dancing-girl-6.gif" alt="Dancing Girl" width="160" height="250">
我需要添加什么(如果有的话)以将图像沿其行放置在任何地方?
预先感谢史蒂夫
使用CSS在页面上定位元素要容易得多。 如果您还不熟悉CSS或至少不熟悉CSS,我强烈建议您外出并从中找到许多教程。
就我所知,执行以下操作:
<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">
应该使图像完美居中并将其锚定到页面底部。 如果您是菜鸟,那是相当多的CSS,这就是为什么我要再说一遍,请确保您开始学习CSS。
希望这可以帮助。
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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.