This time I will bring you html+css+jquery to make tabs, and html+css+jquery to make tabs. What are the things to note?The following is a practical case, let's take a look.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>列表选项卡</title> <style type="text/css"> body{ margin:0px; padding:0px; } #main{ width:310px; border:1px solid #C8C8CC; margin-left:auto; margin-right :auto; margin-top:50px; } .main_title{ width:310px; border-bottom:1px solid #C8C8CC; height:30px; } #main div .chang{ border:1px solid #C8C8CC; float:left; width:153px; height:26px; text-align:center; padding-top :4px; cursor:pointer; } .main_head{ width:310px; height:25px; background-color :#FFF4F8; } .main_head font{ font-size:13px; color:#808080; margin-top:5px; } .main_content{ width:310px; border-top:1px solid #808080; } .main_content ul{ margin-left:-30px; margin-top:5px; width:290px; } .main_content ul li{ list-style-type :none; font-size:13px; color:#2464B2; border-bottom:1px dotted #808080; line-height:27px; } .main_content ul li a{ font-size:13px; color:#2464B2; text-decoration :none; } .main_content ul li a:hover{ text-decoration:underline; } #main div ul.main_content_chang{ width:290px; position:relative; z-index:100; top:0px; left:0px; display:block; } #main div ul{ position:relative; display:none; } </style> <script type="text/javascript" src="js/jquery-1.9.1.js"></script> <script type="text/javascript"> $(function(){ $(".chang").each(function(index){ $(this).click(function(){ $(this).css("background-color","#E02D29"); $(this).siblings("div").css("background-color","#fff"); $("#main div ul").removeClass("main_content_chang"); $(".main_content ul:eq("+index+")").show().siblings("ul").hide(); }) }) }) </script> </head> <body> <div id="main"> <div class="main_title"> <div class="chang" style="background:#E02D29">实时热点</div> <div class="chang" style="float:right;">七日关注</div> </div> <div class="main_content"> <!-----------实时热点--------------> <ul class="main_content_chang"> <li><img src="/static/imghwm/default1.png" data-src="img/1_1.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">来自星星你的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_2.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">私人定制的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/3_1.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">全能星战的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_4.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">加多宝陪千万的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_5.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">女生厕所产子之后上课的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_6.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">圆通夺命快递始末的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_7.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">翻版张柏芝的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_8.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">李彦鹏说谎的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_9.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">1.7亿元存折的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_10.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">90后为讨好男友溺死亲生女的</a></li> <li style="text-align:right; border-bottom-style:none"><a href="#" style="font-size:15px">查看完整榜单</a></li> </ul> <!-----------七日关注--------------------> <ul> <li><img src="/static/imghwm/default1.png" data-src="img/1_1.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">南京出土神秘宝剑的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_2.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">民政局*的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/3_1.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">沃尔玛道歉的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_4.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">买发卡的女孩的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_5.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">假茅台骗两亿贷款的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_6.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">男子收到亡妻圣诞大礼的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_7.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">全球最美的100的</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_8.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">陨石八千万</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_9.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">安培参拜靖国神社</a></li> <li><img src="/static/imghwm/default1.png" data-src="img/1_10.jpg" class="lazy" / alt="html+css+jquery to make tabs" > <a href="#">春晚舞台曝光</a></li> <li style="text-align:right; border-bottom-style:none"><a href="#" style="font-size:15px">查看完整榜单</a></li> </ul> </div> </div> </body> </html>
I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!
Related reading:
How to prompt the save action after a form uploads a file
How to use a button to trigger the flashing of the background color
How to convert table data in html to Json format
How to upload files asynchronously in html
The above is the detailed content of html+css+jquery to make tabs. For more information, please follow other related articles on the PHP Chinese website!

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version
God-level code editing software (SublimeText3)