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

CSS3 realizes the animation effect of lotus blooming

Let’s look at the effect first: This effect looks...

TCP third handshake data transmission process diagram

The process packets with the SYN flag in the RFC7...

Tomcat uses thread pool to handle remote concurrent requests

By understanding how tomcat handles concurrent re...

Basic installation process of mysql5.7.19 under winx64 (details)

1. Download https://dev.mysql.com/downloads/mysql...

jQuery implements clicking left and right buttons to switch pictures

This article example shares the specific code of ...

Practical record of vue using echarts word cloud chart

echarts word cloud is an extension of echarts htt...

If I change a property randomly in Vue data, will the view be updated?

Interviewer: Have you read the source code of Vue...

HTML small tag usage tips

Phrase elements such as <em></em> can ...

mysql group by grouping multiple fields

In daily development tasks, we often use MYSQL...

Introduction to the process of building your own FTP and SFTP servers

FTP and SFTP are widely used as file transfer pro...

How to monitor Tomcat using LambdaProbe

Introduction: Lambda Probe (formerly known as Tom...

A brief understanding of the difference between MySQL union all and union

Union is a union operation on the data, excluding...

HTML (css style specification) must read

CSS style specifications 1. Class Selector 2. Tag...

VM VirtualBox virtual machine mount shared folder

One environment Install VMware Tools on CentOS 7 ...

Util module in node.js tutorial example detailed explanation

Table of contents Starting from type judgment Str...