How make text invisible now that <font> is obsolete? What works according to w3c doesn't work in Firefox.
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>  /* 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>
由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)
选择的解决方案
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>
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.