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

Asked

Viewed 50 times

0

The mobile menu symbol I use does not display in some browsers belonging to 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;
}

2 answers

2


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

The alternatives are:

  • Use an image instead.
  • Use a downloadable font with @font-face. That could mean that some megabytes need to be loaded into user system.

Try to use the &#8801; instead of the &#9776;, are alike.

We can also create a hamburger icon / menu using some CSS and HTML things that work well in all versions of the browsers without making any interval.

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>

Example running: jsfiddle.net

  • Thank you very much! It worked perfectly.

2

A little compliment for response from above. You could the font-awesome, she is light, fast and free.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.