浮动与超链接伪类

DIV浮动(float):
块级元素可以通过浮动实现左右浮动,目的就是让DIV实现类似表格行和列横竖排,浮动时其他块元素会占用原来位置(对后面元素的产生影响)。后续不想浮动可以清除浮动(清除别人的浮动对我的影响!!!) clear:left right both。

<div style="background-color:red; float:left;"></div>

<div style="background-color:blue; float:left;"></div>

<div style="background-color:green; float:left; "></div>

<div style="background-color:red; float:right;  "></div>

<div style="background-color:blue; float:right;  "></div>

<div style="background-color:green; float:right;  "></div>

<!--TIPS:不希望前面的浮动对后面布局产生影响-->

<div style="width:0px; height:0px; clear:both;"></div>

<div style="background-color:yellow;"></div>
注意:
1、浮动时,设置宽高度以便控制位置,一般还要配合margin!!!
2、DIV本身浮动,内部嵌套DIV也应该浮动!!!

 

链接伪类
A选择器:link{}  正常样式

A选择器:hover{} 悬停样式
A选择器:active{} 点击时样式
A选择器:visited{} 点击后样式 ,颜色设置不生效清除浏览器缓存即可。

<style>

.a1:link{

color:red;

text-decoration:none;

}

.a1:hover{

font-size:36px;

color:green;

}

.a1:active{

color:blue;

font-size:12px;

}

.a1:visited{

color:gray;

}

</style>

<a href="#" class="a1">点击右边惊喜</a>
注意顺序!

image001

本文来自投稿,不代表科技代码立场,如若转载,请注明出处https://www.cwhello.com/2262.html

如有侵犯您的合法权益请发邮件951076433@qq.com联系删除

(0)
上一篇 2017年5月24日 09:26
下一篇 2017年5月24日 09:58

相关推荐

联系我们

QQ:951076433

在线咨询:点击这里给我发消息邮件:951076433@qq.com工作时间:周一至周五,9:30-18:30,节假日休息