搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

How make text invisible now that <font> is obsolete? What works according to w3c doesn't work in Firefox.

  • 3 个回答
  • 1 人有此问题
  • 7 次查看
  • 最后回复者为 ferren

more options

Working code was:

<h4 id="02">                                                      /* Heading address */
<a href="#TOC">And the Disbenefits</a>    /* Minor Heading. Return to Table of Contents when clicked */
<span class="navb">                                         /* Tufte left-margin-button code */
<font color="transparent">▼ ▽</font>        /* Blank out major-heading buttons */
<a href="#01">⩓</a> <a href="#03">⩔</a>  /* Show minor previous- and next-buttons */
</span></h4>                                                     /* Close Tufte-hack and heading */

["navb" puts 4 triangular navigation buttons in the left margin, a la Edward Tufte. The buttons should not appear to move if you leave the mouse alone while running down the headings. For most major headings, the first triangle is white, pointing up, and 2 pixels wider than the black button shown, which goes to the final header.]

This made the large triangles disappear for minor headings, without disturbing the small triangles. No other approach I could find prevents jitter when running through a list also containing headers with buttons like

<h2 id="00">                                                                          /* Heading address */
<a href="#TOC">BENEFITS OF RELIGION</a>               /* MAJOR heading. Return to TOC when clicked. */
<span class="navb">                                                          /* Tufte-hack */
<a href="#RD">▼</a> <a href="#09">▽</a>&emsp;  /* FINAL and NEXT major headings */
<a href="#01">⩔</a> </span></h2>                                /* Previous minor meading. Close everything. */

, because the triangles are different sizes for different colors (SLOVENLY FONT DESIGN ! ). But <font> went obsolete after I implemented 400 of these section headings. If you modify the w3c page

https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_font_color_css

you find that

<span style="color:transparent">▼ ▽</span>
works  well -- but not in Firefox. What to do?

</font>

Working code was: <pre><nowiki><h4 id="02"> /* Heading address */ <a href="#TOC">And the Disbenefits</a> /* Minor Heading. Return to Table of Contents when clicked */ <span class="navb"> /* Tufte left-margin-button code */ <font color="transparent">▼ ▽</font> /* Blank out major-heading buttons */ <a href="#01">⩓</a> <a href="#03">⩔</a> /* Show minor previous- and next-buttons */ </span></h4> /* Close Tufte-hack and heading */</nowiki></pre> ["navb" puts 4 triangular navigation buttons in the left margin, a la Edward Tufte. The buttons should not appear to move if you leave the mouse alone while running down the headings. For most major headings, the first triangle is white, pointing up, and 2 pixels wider than the black button shown, which goes to the final header.] This made the large triangles disappear for minor headings, without disturbing the small triangles. No other approach I could find prevents jitter when running through a list also containing headers with buttons like <pre><nowiki><h2 id="00"> /* Heading address */ <a href="#TOC">BENEFITS OF RELIGION</a> /* MAJOR heading. Return to TOC when clicked. */ <span class="navb"> /* Tufte-hack */ <a href="#RD">▼</a> <a href="#09">▽</a>&emsp; /* FINAL and NEXT major headings */ <a href="#01">⩔</a> </span></h2> /* Previous minor meading. Close everything. */</nowiki></pre> , because the triangles are different sizes for different colors (SLOVENLY FONT DESIGN ! ). But <font> went obsolete after I implemented 400 of these section headings. If you modify the w3c page https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_font_color_css you find that <pre><nowiki><span style="color:transparent">▼ ▽</span></nowiki></pre> works well -- but not in Firefox. What to do?

由cor-el于修改

被采纳的解决方案

You can't use <span color="transparent">This is some text.</span> because span doesn't have a 'color' attribute. This cannot work in any sane browser.

You should use CSS style, like this:

<span style="color:transparent">This is another text</span>

or even <span style="display:none">This is invisible text.</span>

定位到答案原位置 👍 1

所有回复 (3)

more options

Submitter's apology:

The page destroyed my code and careful formatting during transmission. Basically, replacing angle brackets with square brackets, my post asked why doesn't replacing:

[font color="transparent"]▼ ▽</font

with

[span color="transparent"]▼ ▽/span

work in Firefox as it does in w3c?

more options

选择的解决方案

You can't use <span color="transparent">This is some text.</span> because span doesn't have a 'color' attribute. This cannot work in any sane browser.

You should use CSS style, like this:

<span style="color:transparent">This is another text</span>

or even <span style="display:none">This is invisible text.</span>

more options

The style="display:none"> makes the triangles disappear, but they no longer serve as place-holders, which was the desired function. style="color:transparent" does the job. It seemed to me that if what was IN the span had a color attribute, this should work. Guess not! Programming is an experimental science.