我应该使用什么标签,而不是html中的弃用标签字体(不能使用CSS) [英] What tag should I use instead of deprecated tag font in html (cannot use CSS)

查看:1012
本文介绍了我应该使用什么标签,而不是html中的弃用标签字体(不能使用CSS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题可以造成误解:我知道我必须使用CSS验证成功我的文档为XHTML 1.0 Transitional。事实是,我必须嵌入在我的网页上的图片组成的零和用文字图片,问题是代码使用弃用的标签字体,看起来像这样

  <! -  IMAGE BEGINS HERE  - > 
< pre>
< font size = - 3>
< font color =#000000> 0001100000101101100011< / font>
< font color =#010000> 00< / font>
< font color =#020101> 0< / font>
< font color =#040101> 0< / font>
< font color =#461919> 1< / font>
< font color =#b54f4f> 1< / font>
... etc.etc ...
< / font>
< / pre>
<! - IMAGE ENDS HERE - >

(在此代码示例中,我在每两个标签后插入一个换行符,由于< pre> 标记,原始代码全部在一行中)。
字体的颜色变化至少几千次,所以我从来没有考虑在CSS中为每个组合创建一个字段。希望有人知道至少在哪里找到一个解决方案,我搜索无处不在:)
感谢

解决方案

您可以替换



< font color =#000000> 0001100000101101100011< / font>





< span style =color:#000000> 0001100000101101100011< / span>





*编辑:我知道这是CSS,但它不涉及单独的样式表,如问题状态,这可能是确定。 $ b

this question can create a misunderstanding: I know I have to use CSS to validate successfully my document as XHTML 1.0 Transitional. The fact is that I have to embed in my webpage a picture composed by zeros and ones created with text image, and the problem is that the code uses deprecated tag font and looks like this

<!-- IMAGE BEGINS HERE -->
<pre>
    <font size="-3">
        <font color="#000000">0001100000101101100011</font>
        <font color="#010000">00</font>
        <font color="#020101">0</font>
        <font color="#040101">0</font>
        <font color="#461919">1</font>
        <font color="#b54f4f">1</font>
        ...etc.etc...
    </font>
</pre>
<!-- IMAGE ENDS HERE -->

(In this code example I inserted a newline after each couple of tags to make it more readable, but the original code is all in one line because of the <pre> tag). The font's color changes at least thousands times so I never considered to create a field in the CSS for each combination.Hope someone knows at least where to find a solution, I searched everywhere :) Thanks

解决方案

You could replace

<font color="#000000">0001100000101101100011</font>

with

<span style="color:#000000">0001100000101101100011</span>

etc...

*Edit: I know this is CSS, but it doesn't involve a separate stylesheet like the question states, which may be ok.

这篇关于我应该使用什么标签,而不是html中的弃用标签字体(不能使用CSS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆