【发布时间】:2014-02-25 11:19:48
【问题描述】:
【问题讨论】:
【问题讨论】:
你可以这样做:
div:before{
position: absolute;
width:1px;height:1px;
background:red;
content:'';
}
div {
position: relative;
border:1px solid green;
height:200px;
background-color:yellow;
}
Demonstration(用更大的红点,这样很明显)
【讨论】:
为了浏览器兼容性,您可以在 div 中添加一个 span:
<div><span></span>hello</div>
然后添加样式:
div {
border:1px solid green;
height:200px;
background-color:yellow;
position:relative;
}
div span {
position:absolute;
height:1px;
width:1px;
background:red;
top:0;
left:0;
}
【讨论】:
这样:
div {
position: relative;
border:1px solid green;
height:200px;
background-color:yellow;
}
div span {
position: absolute;
top: 0;
left: 0;
height: 1px;
width: 1px;
background: red;
}
或者通过图片。
【讨论】:
你应该可以使用:
first-pixel-color-top-left-color: #f00;
【讨论】: