Several implementation methods of the tab bar (recommended)

Several implementation methods of the tab bar (recommended)

Tabs: Category + Description

Tag bar: Category => Let users know where they are and where they are going

1. CSS naming method:

XML/HTML CodeCopy content to clipboard
  1. < div   class = "service-tabs service-tabs1" >   
  2.   
  3.   < ul   class = "service-tabs-inner" >   
  4.     <   class = "on" > < a   href = " #nogo " > Follow </a> </li>   
  5.     < li > < a   href = "#nogo" > Recommendation </ a > </ li >     
  6.     < li > < a   href = "#nogo" > Navigation </ a > </ li >     
  7.     < li > < a   href = "#nogo" > Shopping </ a > </ li >     
  8.   </ ul >   
  9.   
  10. </ div >   
  11.   

Tab: tab

Advantages: 1. Easy to find 2. Comply with SEO standards

2. Layout:

1.<ul><li> </div>
1) float: clear float overflow:hidden;/pseudo class:after/
2) display:inline-block IE7 is not compatible: *display:inline;*zoom:1; White space: font-size:0;/same line/negative margin/letter-spacing

2.<table>

3. Template code:

1. Hover and add background color

CSS CodeCopy content to clipboard
  1. .service-tabs li a{ width : 160px ; height : 80px ; display : block ; color : #666 ; font-size : 32px ;}
  2. .service-tabs1 li a:hover{ color : #2CC185 ;}
  3. .service-tabs1 li.on a{ background-color : #2CC185 ; color : #fff ;} /*Background color*/   

2. Small triangle, obvious

CSS CodeCopy content to clipboard
  1. .service-tabs4 li{ position : relative ;}
  2. .service-tabs4 li a:hover{ color : #2CC185 ;}
  3. .service-tabs4 li.on a{ background-color : #2CC185 ; color : #fff ;}
  4. .service-tabs4 li i{ width : 11px ; height : 7px ; position : absolute ; bottom : - 6px ; left : 76px ; background : url (images/arrow.png); display : none ;}
  5. .service-tabs4 li.on i{ display : block ;}

3. Underline marking

CSS CodeCopy content to clipboard
  1. .service-tabs2 li a:hover{ color : #2CC185 ;}
  2. .service-tabs2 li.on a{ height : 78px ; border-bottom : 2px   solid   #2CC185 ; color : #2CC185 ;}

4. Script Implementation

JavaScript CodeCopy content to clipboard
  1. $( function (){ $( ".service-tabs ul li" ).click( function () { $( this ).addClass( "on" ).siblings().removeClass( "on" ); }); })
  2.   

Simple + Practical

The above several implementation methods of the tab bar (recommended) are all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

<<:  Detailed explanation of mkdir command in Linux learning

>>:  How to remove the blue box that appears when the image is used as a hyperlink

Recommend

Detailed explanation of using javascript to handle common events

Table of contents 1. Form events 2. Mouse events ...

How to use CSS style to vertically center the font in the table

The method of using CSS style to vertically cente...

js to implement a simple bullet screen system

This article shares the specific code of native j...

Improvements to the web server to improve website performance

<br />In the first section of this series, w...

Detailed explanation of the definition and function of delimiter in MySQL

When you first learn MySQL, you may not understan...

Vue uses three methods to refresh the page

When we are writing projects, we often encounter ...

Flex layout realizes left text overflow and omits right text adaptation

I want to achieve a situation where the width of ...

The new version of Chrome browser settings allows cross-domain implementation

Preface Currently, the front-end solves cross-dom...

CSS makes tips boxes, bubble boxes, and triangles

Sometimes our pages will need some prompt boxes o...

Notes on configuring multiple proxies using vue projects

In the development process of Vue project, for th...

Teach you how to build Tencent Cloud Server (graphic tutorial)

This article was originally written by blogger We...

Using CSS3 to implement font color gradient

When using Animation.css, I found that the font o...

How to install binary MySQL on Linux and crack MySQL password

1. Make sure the system has the required libaio s...