簡體   English   中英

將圖像放在HTML頁面上

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM