html建立顶部固定部分

建立顶部固定部分:

<!DOCTYPE html>
<html lang="en">
<head>
    <title>置顶</title>
    <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <style>
	body {
	margin: 0;
	}
	
	#title {
    position: fixed;
    width: 100%;
    height: 46px;
    background-color: white;
    border-bottom:3px solid #5ebafe;
	}
	
	#items {
		padding-top: 46px;
	}
	
	#items div {
        width: 100%;
        height: 200px;
        text-align: center;
        border: #600f0d 1px solid;
    }

	</style>
</head>
<body>
<div id="content">
    <div id="title">
        
    </div>
    <div id="items">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
        <div>7</div>
        <div>8</div>
        <div>9</div>
        <div>10</div>
    </div>
</div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/haoranhaoshi/article/details/108667337
今日推荐