當(dāng)前位置:
首頁 >
php 中margin-top,css margin-top属性怎么用
發(fā)布時(shí)間:2025/3/20
52
豆豆
生活随笔
收集整理的這篇文章主要介紹了
php 中margin-top,css margin-top属性怎么用
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
css margin-top用于在網(wǎng)頁中設(shè)置元素的上外邊距,比如:margin-top: 50px;允許使用負(fù)值,所有主流瀏覽器都支持 margin-top 屬性。
css margin-top屬性怎么用?
margin-top屬性設(shè)置元素的上外邊距。
可設(shè)置的屬性值:
● auto:瀏覽器計(jì)算下外邊距。
● length:規(guī)定以具體單位計(jì)的下外邊距值,比如像素、厘米等。默認(rèn)值是 0px。
● %:規(guī)定基于父元素的寬度的百分比的下外邊距。
● inherit:規(guī)定應(yīng)該從父元素繼承下外邊距。
說明:該屬性允許使用負(fù)值。
注釋:所有主流瀏覽器都支持 margin-top 屬性。
css margin-top屬性 示例
p.ex1 {margin-top:2cm;}
一個(gè)沒有指定邊距大小的段落。
一個(gè)2厘米上邊距的段落。
一個(gè)沒有指定邊距大小的段落。
效果圖:
總結(jié)
以上是生活随笔為你收集整理的php 中margin-top,css margin-top属性怎么用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Matlab某医院用光电比色计,数理统计
- 下一篇: curl php 模拟来源_PHP CU