Home  >  Article  >  Web Front-end  >  How to switch between Chinese and English in the navigation bar in js

How to switch between Chinese and English in the navigation bar in js

php中世界最好的语言
php中世界最好的语言Original
2018-04-18 16:54:402291browse

This time I will show you how to switch between Chinese and English in the navigation bar with js. What are the precautions for switching between Chinese and English in the navigation bar with js. The following is a practical case, let's take a look.

The height of ul is half of li, ul{overflow:hidden}

li:hover{margin-top:-40px;}





中英切换导航条

*{padding:0; margin:0;}
li{ list-style:none; }
a{ text-decoration:none;}
.nav{ width:100%; height:40px; background:#222; margin-top:100px; overflow:hidden;}
.list{ width:1000px; height:40px; margin:0 auto;}
.list li{ float:left;}
.list li a{ display:block; transition:0.3s;}
.list b,.list i{ display:block; padding:0 30px; color:#aaa; line-height:40px; text-align:center;}
.list b{ font-weight:100}
.list i{ font-style:normal; background:#333; color:#fff;}
.list a:hover{ margin-top:-40px;}




 
 
  •      Index   首页     
  •  
  •      course   职业课程     
  •  
  •      study   就业学习     
  •  
  •      BBS   社区     
  •  
  •      JiKe+   发现+     
  •  

    I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

    Recommended reading:

    JS implementation of chessboard coverage

    Detailed explanation of the use of js parasitic combined inheritance

    The above is the detailed content of How to switch between Chinese and English in the navigation bar in js. For more information, please follow other related articles on the PHP Chinese website!

    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn