Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 为div中的像素着色_Css_Html_Colors - Fatal编程技术网

Css 为div中的像素着色

Css 为div中的像素着色,css,html,colors,Css,Html,Colors,我不知道这是否很棘手 下面是一个简单的你好: 有没有什么简单的方法可以将div左上角的像素涂成红色 谢谢。您可以这样做: div:before{ position: absolute; width:1px;height:1px; background:red; content:''; } div { position: relative; border:1px solid green; height:200px; backgroun

我不知道这是否很棘手

下面是一个简单的
你好

有没有什么简单的方法可以将div左上角的像素涂成红色

谢谢。

您可以这样做:

div:before{
    position: absolute;
    width:1px;height:1px;
    background:red;
    content:'';
}
div {
    position: relative;
    border:1px solid green;
    height:200px;
    background-color:yellow;
}
(有一个更大的红点,所以很明显)

您可以这样做:

div:before{
    position: absolute;
    width:1px;height:1px;
    background:red;
    content:'';
}
div {
    position: relative;
    border:1px solid green;
    height:200px;
    background-color:yellow;
}
(有一个更大的红点,所以很明显)

您可以这样做:

div:before{
    position: absolute;
    width:1px;height:1px;
    background:red;
    content:'';
}
div {
    position: relative;
    border:1px solid green;
    height:200px;
    background-color:yellow;
}
(有一个更大的红点,所以很明显)

您可以这样做:

div:before{
    position: absolute;
    width:1px;height:1px;
    background:red;
    content:'';
}
div {
    position: relative;
    border:1px solid green;
    height:200px;
    background-color:yellow;
}

(有一个更大的红点,所以很明显)

您应该能够使用:

first-pixel-color-top-left-color: #f00;

您应该能够使用:

first-pixel-color-top-left-color: #f00;

您应该能够使用:

first-pixel-color-top-left-color: #f00;

您应该能够使用:

first-pixel-color-top-left-color: #f00;

为了与浏览器兼容,您可以在div中添加一个span:

<div><span></span>hello</div>

为了与浏览器兼容,您可以在div中添加一个span:

<div><span></span>hello</div>

为了与浏览器兼容,您可以在div中添加一个span:

<div><span></span>hello</div>

为了与浏览器兼容,您可以在div中添加一个span:

<div><span></span>hello</div>
通过这种方式:

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;
}

或者通过图像。

通过这种方式:

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;
}

或者通过图像。

通过这种方式:

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;
}

或者通过图像。

通过这种方式:

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;
}


或者通过图像。

谢谢您的回答。那么div中的(n,m)坐标呢?我想给整个部门上色。谢谢你的回答。那么div中的(n,m)坐标呢?我想给整个部门上色。谢谢你的回答。那么div中的(n,m)坐标呢?我想给整个部门上色。谢谢你的回答。那么div中的(n,m)坐标呢?我想给整个沙发上色。