這篇文章主要介紹css讓塊靠右的實(shí)現(xiàn)方法,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
成都創(chuàng)新互聯(lián)專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于成都網(wǎng)站制作、做網(wǎng)站、連云港網(wǎng)絡(luò)推廣、微信小程序開發(fā)、連云港網(wǎng)絡(luò)營銷、連云港企業(yè)策劃、連云港品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎;成都創(chuàng)新互聯(lián)為所有大學(xué)生創(chuàng)業(yè)者提供連云港建站搭建服務(wù),24小時(shí)服務(wù)熱線:18982081108,官方網(wǎng)址:www.rwnh.cn
css想讓塊靠右的實(shí)現(xiàn)方法:可以通過float屬性來實(shí)現(xiàn),如【float:right;】,表示元素向右浮動。float屬性用于定義元素在哪個(gè)方向浮動,left表示元素向左浮動,right表示元素向右浮動。
相關(guān)元素:
float 屬性定義元素在哪個(gè)方向浮動。以往這個(gè)屬性總應(yīng)用于圖像,使文本圍繞在圖像周圍,不過在 CSS 中,任何元素都可以浮動。浮動元素會生成一個(gè)塊級框,而不論它本身是何種元素。
屬性值:
left 元素向左浮動。
right 元素向右浮動。
none 默認(rèn)值。元素不浮動,并會顯示在其在文本中出現(xiàn)的位置。
inherit 規(guī)定應(yīng)該從父元素繼承 float 屬性的值。
代碼實(shí)現(xiàn):
<html> <head> <style type="text/css"> img { float:right } </style> </head> <body> <p>在下面的段落中,我們添加了一個(gè)樣式為 <b>float:right</b> 的圖像。結(jié)果是這個(gè)圖像會浮動到段落的右側(cè)。</p> <p> <img src="/i/eg_cute.gif" /> 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> </body> </html>
實(shí)現(xiàn)效果:
以上是“css讓塊靠右的實(shí)現(xiàn)方法”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
本文名稱:css讓塊靠右的實(shí)現(xiàn)方法
分享URL:http://www.rwnh.cn/article4/ipggoe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供云服務(wù)器、網(wǎng)站改版、網(wǎng)站設(shè)計(jì)、網(wǎng)站內(nèi)鏈、網(wǎng)站營銷、自適應(yīng)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)