前言
我是歌謠 我有個兄弟 巅峰的時候排名c站總榜19 叫前端小歌謠 曾經我花了三年的時間創作了他 現在我要用五年的時間超越他 今天又是接近兄弟的一天人生難免坎坷 大不了從頭再來 歌謠的意志是永恒的 放棄很容易 但是堅持一定很酷 本題目源自于牛客網 微信公衆号前端小歌謠
題目
在流中的元素定位屬性值預設都為"static",即沒有定位。此時元素會忽略"top"、"bottom"、"left"、"right"和"z-index"定位屬性。
現在給"section"盒子設定"left: 10px",這時會發現定位屬性無效。完成以上所講的步驟即可通過測試,進入下一節的學習吧。
編輯
核心代碼
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>static</title>
<style type="text/css">margin: 0;
padding: 0;
}
section {
width: 100px;
height: 100px;
background-color: black;
left: 10px;
}
</style>
</head>
<body>
<section></section>
</body>
</html>