Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

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

  • 3 replies
  • 1 has this problem
  • 7 views
  • Last reply by 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?

Modified by cor-el

Chosen solution

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>

Read this answer in context 👍 1

All Replies (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

Chosen Solution

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.