网站结构建设方案,淘宝关键词top排行榜,做网站美工收费,wordpress 有支付接口今天学习的div#xff0c;感觉对编辑html更为方便快捷#xff0c;但还是需要多练#xff0c;多熟悉一下思路和逻辑方式 越来越感觉#xff0c;代码不是重要的#xff0c;重要的是方向和思路#xff0c;am的float clearfloat 及属性#xff0c;还有overflow 溢出的三个属… 今天学习的div感觉对编辑html更为方便快捷但还是需要多练多熟悉一下思路和逻辑方式 越来越感觉代码不是重要的重要的是方向和思路am的float clearfloat 及属性还有overflow 溢出的三个属性 最重要的是边框左圣诞树 做div的布局算数把我整蒙圈了用border四个边距设置来做三角形是重点下午学的盒子 内外边距 边框border margin的重叠取值 和顺序还有css的初始化 一div不是功能标签可以放文字、图片各种元素的块标签常常用来布局 float浮动leftright 左右属性 清除浮动clearleftrightboth左右一起清除 二溢出 overflowhidden超出会隐藏 scroll 滚动条auto 超出有滚动反之。 三用边框样式做圣诞树 三角形 border-top顶 border-left左 border-right右 border-bottom底 PM 盒子模型外边距margin 边框border 内边距padding margin重叠现象只要有一个元素没有float 就会出现重叠这时取相邻最大值 margin的顺序上有下左顺时针 CSS初始化 *{margin:0px; padding:0px;} !DOCTYPE html
htmlheadmeta charsetutf-8titlediv/title!-- div/div不是功能标签可以放文字、图片及各种元素的块标签 常常用来布局 --
style#d1{background-color:blue;width:200px;height:50px;float: left;}#d2{background-color:red;width:200px;height:50px;/* float浮动属性:left,right. */float: right;}#d3{background-color:green;height: 200px;/* 清除浮动 leftrightboth左右一起清除*/clear:both;/* 溢出处理 内容超出div会隐藏overflow: hidden; *//* 不管内容是否超出,都会加滚动条 overflow: scroll;内容不超出div没有滚动条,超出自动添加滚动条 */overflow: auto;/* overfl的属性只能有一个存在 */}#header{width: 0px; height: 0px; border-top: 100px solid white; border-right: 100px solid white; border-bottom: 100px solid green; border-left: 100px solid white; float: left;margin-left: 100px; } #main{ width: 0px; height: 0px;border-top: 200px solid white;border-right: 200px solid white;border-bottom: 200px solid green;border-left: 200px solid white; } #footer{width: 100px;height: 300px;background-color: darkolivegreen;margin-left: 150px; }li{list-style-type: none;float:left;margin: 20px;}/* 盒子模型:外边距:margin
语法margin:20px像素值; --表示4方向外边距都20pxmargin:20px 40px像素值1 像素值2;表示margin-top和bottom 20pxmargin-left和right40pxmargin:20px 40px 60px 80px;像素值1 像素值2 像素值3 像素值4;表示4个方向 top left bottom right 顺时针方向边框:border内边距:paddingmargin重叠现象只要有一个元素没有float属性就会出现重叠现象这时取相邻最大值*//* CSS初始化:*{margin: 0px; padding: 0px;} */#big{width: 100px;height: 100px;background-color: yellow;}#small1{width: 150px;height: 150px;background-color: red;border: 20px solid #00FFFF;/* margin值的顺序是 上右下左 */margin: 10px 20px 40px;padding: 10px;}#small2{width: 100px;height: 100px;background-color: blue;float:left;margin: 10px;}#small3{width: 100px;height: 100px;background-color: magenta;margin:30px;}#small4 {width: 100px;height: 100px;background-color: pink;clear: both;margin: 20px;}
/style /headbodybody idbigdiv idd1我是左div/divdiv idd2我是右div/divdiv idd3我是第三div/divdiv idheader/divdiv idmain/divdiv idfooter/divdiv idsmall1戒指/divdiv idsmall2/divdiv idsmall3/divdiv idsmall4/div/div ulli首页/lili新闻/lili学校概况/li/ul/body
/html View Code 用border做圣诞树 title边框样式圣诞树/titlestyle#a1{width: 0px;height: 0px;background-color: antiquewhite;border-top: 0px solid #00FFFF;border-right: 100px solid white;border-bottom: 100px solid darkgreen;border-left: 100px solid white;margin-left: 340px;}#a2{width: 0px;height: 0px;background-color: antiquewhite;border-top: 0px solid #00FFFF;border-right: 200px solid white;border-bottom:200px solid darkgreen;border-left: 200px solid white;margin-left: 240px;}#a3{width: 0px;height: 0px;background-color: antiquewhite;border-top: 00px solid #00FFFF;border-right: 300px solid white;border-bottom: 300px solid darkgreen;border-left: 300px solid white;margin-left: 140px;}#a4{width: 80px;height: 530px;background-color: orangered;margin-left: 400px;}/style/headbodydiv ida1/divdiv ida2/divdiv ida3/divdiv ida4/div/body 用div做方格子 !DOCTYPE html
htmlheadmeta charsetutf-8title方格子/titlestyle *{margin:0px;padding:0px;}#aa{width: 750px;background-color: lightgray;}#a1{width: 150px;height:150px;background-color: red;float: left; }#a2{width: 150px;height:150px;background-color: blue;float: left; }#a3{width:150px;height:150px;background-color: blanchedalmond;float: left; }#a4{width:150px;height:150px;background-color: aquamarine;float:left; }#a5{width:150px;height:150px;background-color: palegreen;float:right; }#a6{height:200px;width:480px;background-color: cyan;float: left;}#a7{width: 270px;height:275px;background-color:ivory;float: right; } #a8{height:200px;width:330px;background-color: darkorange;float: left;}#a10{width: 270px;height:275px;background-color: red;float: right; } #a11{width: 480px;height:150px;background-color: green; }#a12{width: 100%;height:150px;background-color: orchid;float: left;}#a9{height:200px;width:150px;background-color: greenyellow;float: left;}/style
/headbody idaadiv ida1这是1/divdiv ida2这是2/divdiv ida3这是3/divdiv ida4这是4/divdiv ida5这是5/divdiv ida6这是6/divdiv ida7这是7/divdiv ida8这是8/divdiv ida9这是9/divdiv ida10这是10/divdiv ida11这是11/divdiv ida12这是12/div/body
/html 转载于:https://www.cnblogs.com/zs0322/p/10626486.html