I'm trying to figure out how to get this symbol on my webpage:
What is the symbol called? Is there a way to get it on my webpage like there is to get the ▾ by using
▾
Thank you in advance.
The HR tag is used in web documents to display a horizontal line across the page, sometimes called a horizontal rule. Unlike some tags, this one doesn't need a closing tag. Type <hr> to insert the line.
The "menu" button takes the form of an icon that consists of three parallel horizontal lines (displayed as ≡), suggestive of a list. The name refers to its resemblance to the menu that is typically exposed or opened when interacting with it.
Its simple to add a horizontal line in your markup, just add: <hr>. Browsers draw a line across the entire width of the container, which can be the entire body or a child element.
Adding the Horizontal Line using <hr> tag: The Horizontal Rule tag (<hr>) is used for the purpose of inserting horizontal lines in the HTML document in order to separate sections of the document. It is an empty or unpaired tag that means there is no need for the closing tag.
This is a so-called "hamburger menu".
The closest HTML entity you can get is ≡, bold ≡ ≡
or ≡
, supported almost everywhere.
There is also ☰ ☰
, but it is less supported, in particular it is not available on Android.
It can be enough for a small icon, and if you need a bigger one, here is a pure CSS implementation:
.ham-menu { display: inline-block; position: relative; margin: 35px 0; } /* margin = (width-height)/2 */
.ham-menu, .ham-menu::before, .ham-menu::after { width: 100px; height: 20px; border-radius: 7px; background-color: black; }
.ham-menu::before, .ham-menu::after { content: ""; display: block; position: absolute; }
.ham-menu::before { bottom: 130%; } .ham-menu::after { top: 130%; }
<span class="ham-menu"></span>
All the ways provided in the link in comment are great. but there is also a way not described there, the same as bootstrap is using too. The preference of this method is because it is pure CSS animatable.
<div class="menu-icon">
<span class="line"></span>
<span class="line"></span>
<span class="line"></span>
</div>
.menu-icon > .line {
background-color: #292929;
height: 2px;
display: block;
}
.menu-icon > .line + .line {
margin-top: 8px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With