如何将CSS样式应用于ASCII字符

How do I apply CSS style to ASCII character

提问人:skrhee 提问时间:3/11/2015 最后编辑:BoltClockskrhee 更新时间:2/8/2017 访问量:3387

问:

我想在我的 html 文档中减少我的 ascii 度字符的权重。有人知道怎么做吗?°

HTML格式:

<html>
<body>
    <table>
        <tr>
            <td>
            <div style="position:absolute; top: 70; right: 0;">
                    72
                    <span>&deg;</span>
                    F
            </div>
            </td>
        </tr>
    </table>
</body>
</html>

CSS:

body {
    height: 100%;
    font-weight: 400;
    color: white;
    background-color: #000000;
    overflow: hidden;
}

div{
font-size: 80px;
margin: 2px;
padding: 2px;
}

@font-face {
    font-family: aFont;
    src: url(ostrich-rounded-webfont.ttf);
}

.fontclass{
    font-family: aFont, Helvetica;
    color: #FFFFFF;
 }

a:link {
text-decoration: none;
}

a:visited {
text-decoration: none;
}

a:hover {
 text-decoration: none;
}

a:active {
 text-decoration: none;
}

div span{
    font-weight:1;
    font-size:1px;
}
HTML CSS格式

评论

0赞 Naeem Shaikh 3/11/2015
在特定元素或整个文档中
0赞 skrhee 3/11/2015
仅 ASCII 元素

答:

2赞 G.L.P 3/11/2015 #1

尝试像这样: 演示

CSS:

p {
    font-weight:bold;
}
p span {
    font-weight:100;
    font-size:11px;
}

HTML格式:

<p>Test test Test test Test test  <span> &deg;</span> Test test Test test Test test Test test </p>

编辑:更新的演示

CSS:

p, div{
    font-weight:bold;
}
p span, div span {
    font-weight:100;
    font-size:11px;
}

HTML格式:

<div stile="position:absolute; top:70; right:0;"> 89 <span> &deg;</span> </div>

评论

0赞 skrhee 3/11/2015
我无法让它与 <div> 标签内的跨度一起使用,对此有什么想法吗?
0赞 G.L.P 3/11/2015
你能把你的代码同时发布到你正在使用的html和css吗?这样我就可以试一试了?
0赞 skrhee 3/11/2015
<div stile="position:absolute; top:70; right:0;"> 72 <span> &deg; </span> F </div
0赞 G.L.P 3/11/2015
它适用于您发布的 html 代码。您可以查看我的编辑