溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

HTML怎么將帶標(biāo)題的圖像浮動(dòng)于右側(cè)

發(fā)布時(shí)間:2022-03-05 09:42:24 來(lái)源:億速云 閱讀:174 作者:iii 欄目:web開(kāi)發(fā)

這篇文章主要介紹“HTML怎么將帶標(biāo)題的圖像浮動(dòng)于右側(cè)”的相關(guān)知識(shí),小編通過(guò)實(shí)際案例向大家展示操作過(guò)程,操作方法簡(jiǎn)單快捷,實(shí)用性強(qiáng),希望這篇“HTML怎么將帶標(biāo)題的圖像浮動(dòng)于右側(cè)”文章能幫助大家解決問(wèn)題。

<html>

<head>

<style type="text/css">

div

{

float:right;

width:120px;

margin:0 0 15px 20px;

padding:15px;

border:1px solid black;

text-align:center;

}

</style>

</head>

<body>

<div>

<img src="/i/eg_cute.gif" /><br />

CSS is fun!

</div>

<p>

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

This is some text. This is some text. This is some text.

</p>

<p>

在上面的段落中,div 元素的寬度是 120 像素,它其中包含圖像。div 元素浮動(dòng)到右側(cè)。我們向 div 元素添加了外邊距,這樣就可以把 div 推離文本。同時(shí),我們還向 div 添加了邊框和內(nèi)邊距。

</p>

</body>

</html>

關(guān)于“HTML怎么將帶標(biāo)題的圖像浮動(dòng)于右側(cè)”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí),可以關(guān)注億速云行業(yè)資訊頻道,小編每天都會(huì)為大家更新不同的知識(shí)點(diǎn)。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI