Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do I get a "3 horizontal lines" symbol for my webpage?

I'm trying to figure out how to get this symbol on my webpage:

symbol

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.

like image 222
INeedHelp Avatar asked Jan 09 '16 13:01

INeedHelp


People also ask

How can you insert horizontal lines in a Web page?

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.

What do you call the icon with 3 lines?

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.

How do you add multiple horizontal lines in HTML?

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.

How do I make a horizontal line in HTML?

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.


2 Answers

This is a so-called "hamburger menu".

The closest HTML entity you can get is ≡, bold &#8801; or &equiv;, supported almost everywhere.

There is also ☰ &#9776;, 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>
like image 81
user Avatar answered Oct 13 '22 00:10

user


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;
}
like image 44
Farzad Yousefzadeh Avatar answered Oct 12 '22 23:10

Farzad Yousefzadeh