How to solulate the incompatibility of the mobile menu symbol with some browsers?

0

The mobile menu icon I use does not display some browsers on some tablets that my family owns.

<label class="menumobile" for="bt_menu">&#9776;</label>

CSS

label.menumobile{
    float: left;
    width: 100%;
  color:#fff;
    min-height: auto;
    background-color: #FF8922;
    box-sizing: border-box;
}

 label[for="bt_menu"]{
padding: 5px;
background-color:#FF8922;
color:#fff;
text-align: center;
font-size: 30px;
cursor: pointer;
width: 50px;
height: 50px;
box-sizing: border-box;
}
    
asked by anonymous 28.06.2017 / 13:18

2 answers

2

Apparently, the reason is that no source on the system where the browser running contains the encoding for "☰"

The alternatives are:

  • Use an image instead.
  • Use a download source with @font-face . This may mean that some megabytes need to be uploaded to the user's system.

Try to use &#8801; instead of &#9776; , they are similar.

We can also create a hamburger / menu icon using a few CSS and HTML things that work well on all browser versions without making any breaks.

CSS for icons like:

.hamburger-icon {
    margin: 0;
    padding: 19px 16px;
    display: inline-block;
    position: absolute;
    top: 0;
    left: 0;
}
.hamburger-icon span {
    width: 40px;
    background-color: #000;
    height: 5px;
    display: block;
    margin-bottom: 6px;
}
.hamburger-icon span:last-child {
    margin-bottom:0px;
}

And HTML:

<label class="hamburger-icon">
    <span>&nbsp;</span>
    <span>&nbsp;</span>
    <span>&nbsp;</span>
</label>

Running example: jsfiddle.net

    
28.06.2017 / 13:32
2

A small complement for response from above. You could font-awesome , it is light, fast and free.

    
28.06.2017 / 16:48