如何正确使用CSS内容?

时间:2019-07-03 01:25:37

标签: html css

我在这段代码上遇到麻烦。它一直显示为字母“ a”,而不是移动菜单符号。

enter image description here

.mobile_menu_bar:before {
  position: relative;
  top: 0;
  left: 0;
  font-size: 32px;
  content: "\61";
  cursor: pointer;
}
<div id="et_mobile_nav_menu">
  <div class="mobile_nav closed">
    <span class="select_page">Select Page</span>
    <span class="mobile_menu_bar mobile_menu_bar_toggle"></span>
  </div>
</div>

我想定义以下内容:“ \ 61”吗?

2 个答案:

答案 0 :(得分:0)

22失去了行动。它应该是\2261。请参见下面的代码段:

.mobile_menu_bar:before {
  position: relative;
  top: 0;
  left: 0;
  font-size: 32px;
  content: "\2261";
  cursor: pointer;
}
<div id="et_mobile_nav_menu">
  <div class="mobile_nav closed">
    <span class="select_page">Select Page</span>
    <span class="mobile_menu_bar mobile_menu_bar_toggle"></span>
  </div>
</div>

答案 1 :(得分:0)

您好,您可能忘记了一些代码,请尝试像这样

.mobile_menu_bar:before{
position: relative;
top: 0;
left: 0;
font-size: 32px;
content: "\2261";
cursor: pointer;
}

HTML文件:

<div id="et_mobile_nav_menu">
  <div class="mobile_nav closed">
    <span class="select_page">Select Page</span>
    <span class="mobile_menu_bar mobile_menu_bar_toggle"></span>
  </div>
</div>