HTML for the Pause symbol in audio and video control

試著忘記壹切 提交于 2019-11-28 15:24:34

There are various symbols which could be considered adequate replacements, including:

  1. | | - two standard (bolded) vertical bars.

  2. ▋▋ - ▋ and another▋

  3. ▌▌ - ▌ and another▌

  4. ▍▍ - ▍ and another▍

  5. ▎▎ - ▎ and another▎

  6. ❚❚ - ❚ and another ❚

I may have missed out one or two, but I think these are the better ones. Here's a list of symbols just in case.

Roko C. Buljan

To avoid messing with unsupported characters you can use a scalable icon font set like:

Font Awesome

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<i class="fa fa-arrows-alt"></i>
<i class="fa fa-backward"></i>
<i class="fa fa-compress"></i>
<i class="fa fa-eject"></i>
<i class="fa fa-expand"></i>
<i class="fa fa-fast-backward"></i>
<i class="fa fa-fast-forward"></i>
<i class="fa fa-forward"></i>
<i class="fa fa-pause"></i>
<i class="fa fa-play"></i>
<i class="fa fa-play-circle"></i>
<i class="fa fa-play-circle-o"></i>
<i class="fa fa-step-backward"></i>
<i class="fa fa-step-forward"></i>
<i class="fa fa-stop"></i>
<i class="fa fa-youtube-play"></i>

Google Icons

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<i class="material-icons">pause</i>
<i class="material-icons">pause_circle_filled</i>
<i class="material-icons">pause_circle_outline</i>
<i class="material-icons">fast_forward</i>
<i class="material-icons">fast_rewind</i>
<i class="material-icons">fiber_manual_record</i>
<i class="material-icons">play_arrow</i>
<i class="material-icons">play_circle_filled</i>
<i class="material-icons">play_circle_outline</i>
<i class="material-icons">skip_next</i>
<i class="material-icons">skip_previous</i>
<i class="material-icons">replay</i>
<i class="material-icons">repeat</i>
<i class="material-icons">stop</i>
<i class="material-icons">loop</i>
<i class="material-icons">mic</i>
<i class="material-icons">volume_up</i>
<i class="material-icons">volume_down</i>
<i class="material-icons">volume_mute</i>
<i class="material-icons">volume_off</i>

or any other font-set you can find in the wild.

Player Icons using UTF-8 characters

jsBin demo with extended examples

After an extensive research I hand-picked the best ones that satisfied this requirements:

  • Can be grouped with at least 2 other character symbols
  • Fit gracefully (centered) into the predefined line-height; (like if placed inside <button> element)
  • Require the less amount of adjustments in CSS (like i.e. letter-spacing for pause etc)

NB: StackOverflow's font-family might not be appropriate for this preview, try the code in your page or arrange symbols with the ones that best fit.
Note also that Firefox has an internal glyph set which'll fallback to, while Chrome shows an empty box for the missing ones. Make sure you got the same result across devices and browsers.


◼ ❙❙ ❚❚ ► ⚫ ⏪ ⏩

&#9724; &#10073;&#10073; &#10074;&#10074; &#9658; &#9899; &#9194; &#9193;

◾ ▮▮ ▶ ●

&#9726; &#9646;&#9646; &#9654; &#9679;

◽ ▯▯ ▷ ⚬ ∘

&#9725; &#9647;&#9647; &#9655; &#9900; &#8728; 

◻ ❘ ❘ ▷ ◯

&#9723; &#10072; &#10072; &#9655; &#9711;

▪ ▸ • ▫ ▹ ◦

&#9642; &#9656; &#8226; &#9643; &#9657; &#9702;

(To narrow the space on the some pause icon use CSS: letter-spacing:-1px;)

Extras:

‣ ⌷⌷ ■ □ ∎ ☐ ⟲ ⟳ ⥀
⏏ ☰ ⁌ ⁍ ⧏ ⧐ ∞ ⚫ ⚬

&#8227; &#9015;&#9015; &#9632; &#9633; &#8718; &#8414; &#9744; &#10226; &#10227; &#10560;
&#9167; &#9776; &#8268; &#8269; &#10703; &#10704; &#9288; &#8734; &#9899; &#9900;

⋜ ◽ ॥ ⊲ ∘ ⋝
⌳ ⋈ ∿ ⊶ ⎋ ⚭
⊖⊕⊙
↻↺
≡⋮
≛≣
★★★★☆

&#8924; &#9725; &#2405; &#8882; &#8728; &#8925; //Prv, St, Pau, Ply, Rec, Nxt    
&#9011; &#8904; &#8767; &#8886; &#9099; &#9901; //Fad, X-Fad, Fx, Eq, Pan, Stereo
&#8854;&#8853;&#8857; //Vol-, Vol+, Mute  
&#8635;&#8634; //Repeat    
&#8801;&#8942; //Menu, Options  
&#8795;&#8803; //Favorited, Add to Fav. (Tracks list)  
&#9733;&#9733;&#9733;&#9733;&#9734; // Rating


As you can notice none of the other suggested answers did fit my requirements, and here's an example why:

<h2>Problematic</h2>
<button>||</button> || Two pipes :( bye fellas...
<br><br>
<button>&#9616;&#9616;</button> &amp;#9616;#9616; Too tall and messed spacing!
<br><br>
<button>&#9611;&#9611;</button> &amp;#9611;#9611; Too large and messed spacing!
<br><br>
<button>&#9616;&nbsp;&#9612;</button> &amp;#9616;&amp;#9616; Lovable but... Tall and cannot fit-size with any other player symbol
<br><br>
<button>&#9612;&#9612;</button> &amp;#9612;&amp;#9612; Way too tall and messed spacing!
<br><br>
<button>&#9623; &#9622;</button> &amp;#9623;&amp;#9622; Wrong alignment + extra spacing
<br><br>
<button>&#11044;</button> &amp;#11044; Height...
<br><br>

P.S: UTF-8 Unicode Characters Generator from: https://stackoverflow.com/a/25986009

Following may come in handy:

  • &#x23e9;
  • &#x23ea;
  • &#x24eb;
  • &#x23ec;
  • &#x23ed;
  • &#x23ee;
  • &#x23ef;
  • &#x23f4;
  • &#x23f5;
  • &#x23f6;
  • &#x23f7;
  • &#x23f8;
  • &#x23f9;
  • &#x23fa;

NOTE: apparently, these characters aren't very well supported in popular fonts, so if you plan to use it on the web, be sure to pick a webfont that supports these.

marcusmichaels

▐▐  is HTML and is made with this code: &#9616;&#9616;.

Here's an example JSFiddle.

I found it, it’s in the Miscellaneous Technical block. ⏸ (U+23F8)

I'm using ▐ ▌

HTML: &#9616;&nbsp;&#9612;

CSS: \2590\A0\258C

If you want one that's a single character to match the right-facing triangle for "play," try Roman numeral 2. Ⅱ is &#8545; in HTML. If you can put formatting tags around it, it looks really good in bold. is <b>&#8545;</b> in HTML. This has much better support than the previously mentioned double vertical bar.

Modern browsers support 'DOUBLE VERTICAL BAR' (U+23F8), too:

http://www.fileformat.info/info/unicode/char/23f8/index.htm

For a music player it can act as a companion for 'BLACK RIGHT-POINTING POINTER' (U+25BA) because they both share equal width and height making it perfect for a play/pause button:

http://www.fileformat.info/info/unicode/char/25ba/index.htm

There is no character encoded for use as a pause symbol, though various characters or combinations of characters may look more or less like a pause symbol, depending on font.

In a discussion in the public Unicode mailing list in 2005, a suggestion was made to use two copies of the U+275A HEAVY VERTICAL BAR character: ❚❚. But the adequacy of the result depends on font; for example, the glyph might have been designed so that the bars are too much apart. – The list discussion explains why a pause symbol had not been encoded, and this has not changed.

Thus, the best option is to use an image. If you need to use the symbol in text, it is best to create it in a suitably large size (say 60 by 60 pixels) and scale it down to text size with CSS (e.g., setting height: 0.8em on the img element).

The ISO 7000 / IEC 60417 Symbol for Pause; Interruption is #5111B. See Media_Controls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!