aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/html/element/basefont
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/html/element/basefont
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/html/element/basefont')
-rw-r--r--files/zh-cn/web/html/element/basefont/index.html111
1 files changed, 111 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/element/basefont/index.html b/files/zh-cn/web/html/element/basefont/index.html
new file mode 100644
index 0000000000..9270e149c9
--- /dev/null
+++ b/files/zh-cn/web/html/element/basefont/index.html
@@ -0,0 +1,111 @@
+---
+title: <basefont>
+slug: Web/HTML/Element/basefont
+tags:
+ - Web
+ - 元素
+translation_of: Web/HTML/Element/basefont
+---
+<div>{{obsolete_header}}</div>
+
+<h2 id="概要">概要</h2>
+
+<p>HTML标签&lt;basefont&gt;用来设置文档的默认字体大小。使用{{HTMLElement("font")}}可以相对于默认字体大小进行变化。</p>
+
+<div class="note">
+<p><em>使用说明: </em></p>
+
+<p><strong>不要再使用这个标签! </strong>尽管在HTML 3.2中曾经(不严格地)标准化,但是它并不被主流的浏览器所支持。而且,不同的浏览器、甚至同一浏览器的相邻版本,都没有使用相同的实现方式; 实际上,使用这个标签总是导致不确定的结果。</p>
+
+<p>&lt;basefont&gt;元素,同其他只与样式相关的元素一起,在标准中不被建议使用。从HTML 4起,HTML不再传递样式信息(除{{HTMLElement("style")}} 元素和所有元素的<strong>style</strong>属性内容外)。在HTML5,这个元素已经被彻底移除。对于所有新的网页开发,样式只应该写在CSS中。</p>
+
+<p>使用<a href="/en-US/docs/Web/CSS/CSS_Fonts">CSS Fonts</a>属性,同样能够实现 {{HTMLElement("font")}}的效果,甚至更好控制。</p>
+</div>
+
+<h2 id="属性">属性</h2>
+
+<p>如同其他HTML元素一样,它支持<a href="/en-US/docs/HTML/Global_attributes" title="HTML/Global attributes">全局属性</a>.</p>
+
+<dl>
+ <dt>{{htmlattrdef("color")}}</dt>
+ <dd>该属性使用颜色名称或者形如#RRGGBB的十六进制格式设置字体的颜色。</dd>
+ <dt>{{htmlattrdef("face")}}</dt>
+ <dd>该属性包含一个或多个字体名称。文档文字默认按照第一个浏览器支持的字体进行渲染。如果所有列出的字体本地系统都未安装,浏览器默认使用该系统上的定比或者定宽字体。</dd>
+ <dt>{{htmlattrdef("size")}}</dt>
+ <dd>该属性定义了字体大小的,使用数值或者相对值。数值值域为1~7,1最小,默认值为3。</dd>
+</dl>
+
+<h2 id="DOM接口">DOM接口</h2>
+
+<p>该元素实现了<code><a href="/en-US/docs/DOM/HTMLBaseFontElement" title="DOM/HTMLBaseFontElement">HTMLBaseFontElement</a>接口</code>.</p>
+
+<h2 id="示例">示例</h2>
+
+<pre>&lt;basefont color="#FF0000" face="Helvetica" size="+2" /&gt;
+</pre>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Edge</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Edge</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="备注">备注</h2>
+
+<ul>
+ <li>HTML 3.2 支持basefont元素,但只支持size属性。</li>
+ <li>严格HTML和XHTML均不支持该元素。</li>
+ <li>尽管曾是过渡标准的一部分,许多像Mozilla与Opera这些聚焦正式标准的浏览器并不支持该元素。</li>
+ <li>该元素的效果可以通过CSS规则实现,为 {{HTMLElement("body")}} 设置CSS属性即可。</li>
+ <li>XHTML 1.0 要求这个元素包含结尾的斜杠: <code>&lt;basefont /&gt;</code>.</li>
+</ul>
+
+<div>{{HTMLRef}}</div>