<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>CSS+DIV布局</title> <link href="StyleSheet1.css" rel="stylesheet" type="text/css" /> </head> <body> <div> <div id="top">标题Logo栏</div> <div id="navigation">导航栏</div> <div id="left" >左边</div> <div id="middle">中间</div> <div id="right">右边</div> <div id="bottom" >页脚</div> </div> </body> </html>/*stylesheet1.css*/ #top{ width:100%; height:300px; line-height:300px; font-family:"黑体"; font-size:xx-large; } #navigation { width: 100%; height: 60px; line-height: 60px; } #left { width: 10%; height: 220px; line-height: 220px; float:left; } #middle{ width: 80%; height: 220px; line-height: 220px; float: left; } #right { width: 10%; height: 220px; line-height: 220px; float: left; clear:right; } #bottom { width: 100%; height: 30px; line-height: 30px; font-family: "黑体"; clear:both; }<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>定位</title> <style type="text/css"> div { padding: 0; margin: 0; } #id1 { width: 524px; text-align: left; height: 404px; border: solid 1px red; } #id2 { width: 120px; text-align: left; height: 120px; border: solid 1px blue; margin: 0; margin: 0; } #id3 { width: 200px; text-align: left; height: 140px; border: solid 1px green; position: absolute; top: 130px; left: 130px; margin: 0; } #id4 { width: 200px; text-align: left; height: 140px; border: solid 1px purple; position: relative; top: 140px; left: 200px; margin: 0; } </style> </head> <body> <div id="id1"> <div id="id2"> <div id="id3"> <div id="id4"></div> </div> </div> </div> </body> </html>把他们三个组合起来
时间: 2023-05-15 08:05:27 浏览: 285
这是一个HTML文件,其中包含了一个CSS样式表文件(StyleSheet1.css)。HTML文件中有一个<div>标签,其中包含了6个子<div>标签,分别是:标题Logo栏、导航栏、左边、中间、右边和页脚。这些子<div>标签都有一个唯一的ID属性,可以在CSS样式表文件中对它们进行样式设置。这个HTML文件使用了UTF-8编码。
阅读全文