Home Web Front-end HTML Tutorial Several implementation methods of tab bar in HTML

Several implementation methods of tab bar in HTML

Dec 11, 2017 am 11:33 AM
html accomplish method

There are many uses of tags in HTML. This article recommends several implementation methods for the tag bar. It is very useful for learning tag knowledge. I hope it can help everyone.

Tag page: Category + Description

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

##1. CSS naming method:


##XML/HTML Code

Copy content to clipboard


    ##<
  1. p class ="service-tabs service-tabs1">


  2. ## 

    <
  3. ul

    class="service-tabs-inner">   <

  4. li

    class="on"><a href="#nogo">Followa>li>  <

  5. li

    ><a href="#nogo ">Recommendeda>li> <

  6. li

    >< a href="#nogo">Navigationa>li>#  <

  7. li
  8. ><a href="#nogo" >Shoppinga>li>## 

    ul
  9. >

  10. #
    p

  11. >

  12. #Tab page: tab

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


2. Layout method:

##1.
  • < /p>

    1) float: clear float overflow:hidden;/pseudo-class:after/

    2) display:inline-block IE7 is not compatible: *display:inline;*zoom:1; blank interval: font font -size:0;/same line/negative margin/letter-spacing

    2.

    ##3. Template code:



    1. Add background color when hovering

    ##CSS CodeCopy content to clipboard



    ##.service-tabs li a{

    width:160px;height

    :

    80px
    ;

    display
      :
    1. 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{
    5. width

      :11px;height:7px;position:absolute;bottom bottom:-6px;left:76px;background:url(images /arrow.png);display:none;}

    6. .service-tabs4 li.on i{
    7. display

      :block;}


    ##3. Underline


    CSS Code

    Copy content to clipboard


    ## .service-tabs2 li a:hover{

    color
      :
    1. #2CC185

      ;} ##.service-tabs2 li.on a{height

      :
    2. 78px
    3. ;

      border-bottom:2px solid #2CC185; color:#2CC185;}


    #4. Script Implementation

    ##JavaScript Code

    Copy content to the clipboard


    $(

    function

    (){ $(
    ".service-tabs ul li"

    ).click(
      function
    1. () { $(

      this).addClass("on").siblings().removeClass("on"); } ); }) It is simple and very practical. Have you learned it? Hurry up and get your hands dirty. Related recommendations:

    html How to use the img tag

    ##HTML5 new tag usage method

    htmlCommonly used format tags

    The above is the detailed content of Several implementation methods of tab bar in HTML. For more information, please follow other related articles on the PHP Chinese website!

    Statement of this Website
    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

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    Video Face Swap

    Video Face Swap

    Swap faces in any video effortlessly with our completely free AI face swap tool!

    Hot Tools

    Notepad++7.3.1

    Notepad++7.3.1

    Easy-to-use and free code editor

    SublimeText3 Chinese version

    SublimeText3 Chinese version

    Chinese version, very easy to use

    Zend Studio 13.0.1

    Zend Studio 13.0.1

    Powerful PHP integrated development environment

    Dreamweaver CS6

    Dreamweaver CS6

    Visual web development tools

    SublimeText3 Mac version

    SublimeText3 Mac version

    God-level code editing software (SublimeText3)

    Hot Topics

    Java Tutorial
    1657
    14
    PHP Tutorial
    1257
    29
    C# Tutorial
    1229
    24
    Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

    Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

    Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

    This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

    HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

    Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

    HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

    Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

    HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

    Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

    HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

    Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

    HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

    Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

    How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

    This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

    See all articles