display&position
display&position
发布时间:2016-12-29 来源:查字典编辑
摘要:display:block将子对象作为块对象呈递。很多内联样式的效果,需要用到display。#photoaimg{border:3pxso...

display:block将子对象作为块对象呈递。很多内联样式的效果,需要用到display。

#photo a img{border:3px solid #FF6600; }#photo a:hover {display:block;} /**若不加此句,则内联对象img的样式不会显示**/#photo a:hover img{ border:2px solid blue;}

display&position1

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

position内容的尺寸根据布局尺寸确定对象的尺寸。

#text{position:relative;} /**若没有,则内联对象不显示。若为block,会作为块级元素而使虚线过长。posigion时,长度由text的内容决定。**/#text span{width:200px; height:20px;border-bottom: 1px dashed #000000 ;}

示例文字 下划线样式

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新 Div+Css教程学习
热门 Div+Css教程学习
网页设计子分类