导航

CSS :after 伪元素在元素之后添加内容

Posted on 2011-10-02 23:07  erlan80  阅读(2741)  评论(1)    收藏  举报

 

:after   可以不让里面有滚动元素超出外div

那在外div的css样式想下面一样设置

.box_tt_1  /* 外面的样式*/
{
background-image:url(img/main_1_0.png);
background-position:0 0;
background-repeat: repeat-x;
border-style: solid;
border-width: 1px 1px 0 1px;
padding: 0.54em 0.77em;
border-color: #DBE1E6;
font-size: 93%;
position: relative;
}

  /* 外面的样式 后面加:after*/

.box_tt_1:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}

而在w3schoo 说的说明  http://www.w3school.com.cn/css/pr_pseudo_after.asp