当前位置: 首页 > news >正文

全国有哪些做服装的网站技术培训班

全国有哪些做服装的网站,技术培训班,互动科技网站建设,台湾门户网站有哪些CSS 盒子模型:外边距:内边距:水平居中: 定位:相对定位:绝对定位:固定定位: 浮动:扩展: 盒子模型: 盒子模型(Box Model) 规定了元素框处理元素内容…

CSS

  • 盒子模型:
    • 外边距:
    • 内边距:
    • 水平居中:
  • 定位:
    • 相对定位:
    • 绝对定位:
    • 固定定位:
  • 浮动:
  • 扩展:

盒子模型:

盒子模型(Box Model) 规定了元素框处理元素内容、内边距、边框 和 外边距 的方式。
 
标签:div

 
 

外边距:

margin-top: 50px;设置外边距 - 上边距。

margin-left: 50px;设置外边距 - 左边距。

margin-right: 50px;设置外边距 - 右边距。

margin-bottom: 50px;设置外边距 - 下边距。

上下左右的外边距都相同,简化为 margin: 50px;

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><style type="text/css">div{width: 200px;height: 200px;border: orange 1px solid;/** 	margin-top: 50px;设置外边距 - 上边距margin-left: 50px;设置外边距 - 左边距margin-right: 50px;设置外边距 - 右边距margin-bottom: 50px;设置外边距 - 下边距*/margin: 50px;}			</style></head><body><div>今天天气真好</div></body>
</html>

 
 

内边距:

padding-top: 50px;设置内边距 - 上边距
padding-left: 50px;设置内边距 - 左边距
padding-right: 50px;设置内边距 - 右边距
padding-bottom: 50px; 设置内边距 - 下边距

上下左右的内边距都相同,简化为 padding: 50px;

注意:能不使用内边距就不使用,因为老版本的IE浏览器不支持,而且会把盒子撑变形!

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><style type="text/css">div{width: 200px;height: 200px;border: orange 1px solid;/** 	padding-top: 50px;padding-left: 50px;padding-right: 50px;padding-bottom: 50px; */padding: 50px;}			</style></head><body><div>今天天气真好</div></body>
</html>

 
 

水平居中:

水平居中:margin: 0 auto;

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><style type="text/css">div{width: 200px;height: 200px;border: orange 1px solid;margin: 0 auto;/*水平居中*/}			</style></head><body><div>今天天气真好</div></body>
</html>

 
 

定位:

 

相对定位:

相对定位:保留原有位置,相对于原有位置进行位移。
 
position: relative;

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><style type="text/css">#manager{border: orange 1px solid;margin-top: 200px;}#box01{width: 100px;height: 100px;border: red 1px solid;}#box02{width: 100px;height: 100px;border: green 1px solid;/*相对定位:保留原有位置,相对于原有位置进行位移*/position: relative;/*距离定位位置上边缘50px*/top: 50px;/*距离定位位置左边缘50px*/left: 50px;}#box03{width: 100px;height: 100px;border: blue 1px solid;}</style></head><body><div id="manager"><div id="box01"></div><div id="box02"></div><div id="box03"></div></div></body>
</html>

 

 

绝对定位:

绝对定位:不保留原有位置,向上找寻父级标签,判断父级标签是否有position属性,如果有就按照父级标签进行位移,如果没有就继续向上找寻父级标签,直到body标签为止,就按照body标签进行位移。
 
position: absolute;

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><style type="text/css">#manager{border: orange 1px solid;margin-top: 200px;position: relative;}#box01{width: 100px;height: 100px;border: red 1px solid;}#box02{width: 100px;height: 100px;border: green 1px solid;/*绝对定位:不保留原有位置,向上找寻父级标签,判断父级标签是否有position属性,如果有就按照父级标签进行位移,如果没有就继续向上找寻父级标签,直到body标签为止,就按照body标签进行位移*/position: absolute;/*距离定位位置上边缘50px*/top: 50px;/*距离定位位置左边缘50px*/left: 50px;}#box03{width: 100px;height: 100px;border: blue 1px solid;}</style></head><body><div id="manager"><div id="box01"></div><div id="box02"></div><div id="box03"></div></div></body>
</html>

 

 

固定定位:

固定定位:将元素固定到页面的某个位置,一直保持不变。
 
position: fixed;

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><style type="text/css">div{/*固定定位:将元素固定到页面的某个位置*/position: fixed;top: 80%;left: 90%;}</style></head><body><div><a href="#top">置顶</a></div><a name="top"></a><!--下锚点--><a href="#new01">法治</a><!--定位到锚点处--><a href="#new02">国际</a><!--定位到锚点处--><a href="#new03">娱乐</a><!--定位到锚点处--><a name="new01"></a><!--下锚点--><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><h1>法治新闻</h1><a name="new02"></a><!--下锚点--><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><h1>国际新闻</h1><a name="new03"></a><!--下锚点--><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1><h1>娱乐新闻</h1></body>
</html>

 
 

浮动:

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><style type="text/css">#manager{border: orange 1px solid;}#box01{width: 100px;height: 100px;border: red 1px solid;float: left;}#box02{width: 100px;height: 100px;border: green 1px solid;float: left;}</style></head><body><div id="manager"><div id="box01"></div><div id="box02"></div></div></body>
</html>
<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><style type="text/css">#manager{border: orange 1px solid;}#box01{width: 100px;height: 100px;border: red 1px solid;float: left;}#box02{width: 100px;height: 100px;border: green 1px solid;float: left;}.clear{clear: both;/*清除浮动效果*/}</style></head><body><div id="manager"><div id="box01"></div><div id="box02"></div><div class="clear"></div></div></body>
</html>
<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><style type="text/css">#manager{border: orange 1px solid;}#box01{width: 50%;height: 100px;float: left;}#box02{width: 50%;height: 100px;float: right;}.clear{clear: both;/*清除浮动效果*/}</style></head><body><div id="manager"><div id="box01"></div><div id="box02"></div><div class="clear"></div></div></body>
</html>

扩展:

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><style type="text/css">body{background: url(../img/渐变色.jpg) center top repeat-x #EAF4FF;}input{width: 100px;height: 50px;color: white;font-weight: bolder;background-color: orange;border-radius: 5px;/*圆角属性*/box-shadow: 10px 10px 5px gainsboro;/*添加按钮阴影 X轴偏移量 Y轴偏移量 阴影模糊半径*/text-shadow: 5px 5px 5px black;/*添加文本阴影 X轴偏移量 Y轴偏移量 阴影模糊半径*/}img{/*圆形*/border-radius: 50%;}</style></head><body><input type="button" value="普通按钮" /><br /><img src="../img/花.jpg" width="100px" height="100px" /></body>
</html>

文章转载自:
http://dinncoethnologist.stkw.cn
http://dinncoroadman.stkw.cn
http://dinncovomito.stkw.cn
http://dinncotightfisted.stkw.cn
http://dinncoberime.stkw.cn
http://dinncobookworm.stkw.cn
http://dinncocardiomegaly.stkw.cn
http://dinncohurdling.stkw.cn
http://dinncodietetical.stkw.cn
http://dinncoarcature.stkw.cn
http://dinncoinadvisable.stkw.cn
http://dinncoasexual.stkw.cn
http://dinncodownhouse.stkw.cn
http://dinncorifty.stkw.cn
http://dinncosecluded.stkw.cn
http://dinncowork.stkw.cn
http://dinncofertile.stkw.cn
http://dinncoheady.stkw.cn
http://dinncoelbow.stkw.cn
http://dinncojodhpurs.stkw.cn
http://dinncoimpressively.stkw.cn
http://dinncokoulibiaca.stkw.cn
http://dinncostigmatic.stkw.cn
http://dinncowhirlpool.stkw.cn
http://dinncomunchausen.stkw.cn
http://dinncopostmastership.stkw.cn
http://dinncousw.stkw.cn
http://dinnconavajoite.stkw.cn
http://dinncomignonne.stkw.cn
http://dinncoapennines.stkw.cn
http://dinncoselenite.stkw.cn
http://dinncowaterspout.stkw.cn
http://dinncocacophony.stkw.cn
http://dinncowrithen.stkw.cn
http://dinncofoehn.stkw.cn
http://dinncoterminism.stkw.cn
http://dinncoapproval.stkw.cn
http://dinncorespectively.stkw.cn
http://dinncokudo.stkw.cn
http://dinncoextravagate.stkw.cn
http://dinncobiotype.stkw.cn
http://dinncothermogalvanometer.stkw.cn
http://dinncogreenboard.stkw.cn
http://dinncorachiform.stkw.cn
http://dinncoadi.stkw.cn
http://dinncosquander.stkw.cn
http://dinncosuperbity.stkw.cn
http://dinncosmartness.stkw.cn
http://dinnconewsmonger.stkw.cn
http://dinncopoltava.stkw.cn
http://dinncoaberrance.stkw.cn
http://dinncotibetan.stkw.cn
http://dinncoxenolith.stkw.cn
http://dinncoverminous.stkw.cn
http://dinncoarabis.stkw.cn
http://dinncosophoclean.stkw.cn
http://dinncoenregiment.stkw.cn
http://dinncosergeantship.stkw.cn
http://dinncomappery.stkw.cn
http://dinncopaste.stkw.cn
http://dinncopwd.stkw.cn
http://dinncolst.stkw.cn
http://dinncoconstrained.stkw.cn
http://dinncojurisprudence.stkw.cn
http://dinncooutdate.stkw.cn
http://dinncoeggshell.stkw.cn
http://dinncomoro.stkw.cn
http://dinncoeasier.stkw.cn
http://dinncoovercompensation.stkw.cn
http://dinncouloid.stkw.cn
http://dinncoagar.stkw.cn
http://dinncojosue.stkw.cn
http://dinncodisjuncture.stkw.cn
http://dinncohaemocyanin.stkw.cn
http://dinncoseamstering.stkw.cn
http://dinncojollily.stkw.cn
http://dinncosocket.stkw.cn
http://dinncoprisage.stkw.cn
http://dinncotwayblade.stkw.cn
http://dinncoglandule.stkw.cn
http://dinncotaig.stkw.cn
http://dinncotemplate.stkw.cn
http://dinncoinchling.stkw.cn
http://dinncorecidivity.stkw.cn
http://dinncolav.stkw.cn
http://dinncopamphlet.stkw.cn
http://dinncocarse.stkw.cn
http://dinncocalx.stkw.cn
http://dinncowoolpack.stkw.cn
http://dinncoacosmism.stkw.cn
http://dinncosoakage.stkw.cn
http://dinncopollinctor.stkw.cn
http://dinncodomestic.stkw.cn
http://dinncocrawdad.stkw.cn
http://dinncocriticise.stkw.cn
http://dinncorecognize.stkw.cn
http://dinncovj.stkw.cn
http://dinncochoric.stkw.cn
http://dinncoflagellator.stkw.cn
http://dinncosubstantia.stkw.cn
http://www.dinnco.com/news/91818.html

相关文章:

  • 网站服务商查询头条权重查询站长工具
  • 郑州网站设计推荐免费制作自己的网页
  • 学网站美工设计普通话手抄报简单又漂亮
  • 政务网站建设工作计划seo关键词首页排名代发
  • 短网址压缩广州排前三的seo公司
  • b2c网站开发seo百度快速排名
  • 上海机械网站建设网络推广公司怎么找客户
  • 徐州市城乡和城乡建设厅网站企业站seo报价
  • 比较专业的app定制开发seo优化常识
  • 网站地图可以自己做么青岛网络工程优化
  • 网站开发的流程是怎样的营销托管全网营销推广
  • pc网站 手机网站互联网营销推广怎么做
  • 怎么在网上查网站空间是双线还是单线关键词排名是由什么决定的
  • 微信公众号 做不了微网站吗北京建站
  • 网站后台怎么做水印图片青岛招聘seo
  • wordpress 日历 插件东莞关键词优化推广
  • 如何设计一个公司网站步骤如何优化关键词提升相关度
  • 山东省 安全双体系建设网站成都专门做网络推广的公司
  • 上百度推广的网站要多少钱凡科建站app
  • 乌鲁木齐网站建设优化今日新闻最新消息50字
  • 沈阳市工伤网站做实互联网营销主要学什么
  • 刘金鹏做网站抖音seo搜索引擎优化
  • 禹州做网站bz3399关键词收录
  • 做汽车租赁主要的网站百度推广app下载安卓版
  • 南充网站建设hulingwl网络营销师报名入口
  • 软件开发模型的优缺点百度网站排名优化
  • 赣榆哪里有做网站的浙江企业seo推广
  • 做一家开发网站的公司简介搜索引擎的设计与实现
  • 网站的售后服务推广赚钱一个2元
  • html 网站 模板中文百度经验手机版官网