摘要:浮動float,其屬性只有相左left和想youright浮動浮動后需要用clear:both來清除浮動具體使用浮動做的導(dǎo)航欄代碼如下:<html> <head> <meta charset="utf-8&
浮動float,其屬性只有相左left和想youright浮動
浮動后需要用clear:both來清除浮動
具體使用浮動做的導(dǎo)航欄代碼如下:
<html> <head> <meta charset="utf-8"> <title>邊框</title> <link rel="icon" href="" type="image/x-icon"> <style type="text/css"> .border{ width: 100px; height: 100px; border: none/*1px solid #ccc*/; border-radius: 50%; box-shadow: 0px 10px 100px #ccc; float: left; background-color: #bbb; } ul li{list-style: none; width: 80px;height: 30px;background: #ccc;margin: 2px;line-height: 30px;text-align: center;float: left;} </style> </head> <body> <ul> <li>JAVA</li> <li>PHP</li> <li>HTML</li> <li>MYSQL</li> </ul> </body> </html> <html>
使用浮動前
使用浮動后
批改老師:天蓬老師批改時間:2019-03-19 09:27:57
老師總結(jié):清浮動的方式很多, 評價的標(biāo)準(zhǔn)就是不要在頁面中添加多余的html標(biāo)簽, 要保持一定的兼容性