New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css] 第37天 不使用border画出1px高的线,在不同浏览器的标准和怪异模式下都能保持效果一样 #137
Comments
用border-image是否可以实现 |
|
我不知道不用border怎么搞,期待楼主公布答案~不过楼上的肯定不对,hr这个标签跨浏览器行为完全不同,就这么一个size属性绝对不行 |
能想到的方法就是使用 .border {
width: 100%;
height: 1px;
background: blue;
} <div class="border"></div> |
既然是css那么就用css的方法啊! |
height: 1px; background-color: red; |
box-shadow |
.box1 {
height: 38px;
width: 100%;
box-shadow: 0 1px 0 0 #000;
}
.box2 {
background-color: #000;
height: 1px;
}
.box3:after{
content: '';
display: block;
height: 1px;
background-color: #000;
}
hr {
height: 1px;
border-width: 0;
color: #000;
background-color: #000;
} <div class="box1">
<br>
box-shadow
</div>
<br>
height: 1px;
<div class="box2"></div>
<br>
:after{... height: 1px;}
<div class="box3"></div>
<br>
hr
<hr> 不太明白标准和怪异模式的区别以及怎样设置,这四条线在各浏览器下都是1px,IE9以下不支持 |
|
.line { .line::before { |
第37天 不使用border画出1px高的线,在不同浏览器的标准和怪异模式下都能保持效果一样
The text was updated successfully, but these errors were encountered: