Realizing the sliding door effect of web pages based on HTML+CSS
You often see such a navigation effect on web pages. Because of its widespread use, programmers have given it a name called sliding door. This article introduces to you how to realize the sliding door effect of web pages based on HTML CSS technology. Friends who need it can refer to it
, What is a sliding door
You often see such a navigation effect on web pages. Because of its widespread use, most programmers have given it a name called sliding door. .Before learning about sliding doors, you must first understand what sliding doors are.
Xiaomi official website, web sliding door effect
2. Technology required to realize sliding door
Simple HTML basics
Simple CSS basic styles
CSS positioning
3. How to implement a sliding door
1. Prepare a piece of HTML code
<p class="bg"> <ul> <li> <a href="#">手机 电话卡</a> <p class="p1"> <p>这是我的第一个滑动门</p> <img src="img/海贼.jpg" alt="" width="100%" height="100%"> </p> </li> <li> <a href="#">手机 电话卡</a> <p class="p2"></p> </li> <li> <a href="#">手机 电话卡</a> <p class="p3"></p> </li> <li> <a href="#">手机 电话卡</a> <p class="p3"></p> </li> </ul> </p>
2. Add some styles to the current HTML structure
<style> body,ul,li,p{ margin:0; padding:0; } ul{ list-style: none; padding:20px 0px; width: 234px; background: rgba(0,0,0,.6); /*定位 作为父级使用*/ position: relative; } ul li{ height: 42px; line-height: 42px; padding-left: 20px; } ul li:hover{ background: #ff6700; } ul li a{ color: #fff; text-decoration: none; font-size: 14px; } </style>
3. Use positioning to achieve the sliding door effect
/*滑动门*/ ul .p1,.p2,.p3{ width: 800px; height: 460px; background: skyblue; /*使用定位实现滑动门-------重要步骤*/ /*上海尚学堂java 加薇心 java8733 了解更多获取资料 */ position: absolute; top:0; left:234px; display: none; } /*当鼠标悬停在内容上是显示对应的代码块*/ ul li:hover .p1{ display: block; width:800px; opacity: 1; } ul li:hover .p2{ display: block; background: pink; width:600px; height: 460px; }
According to the above steps, you can achieve a simple sliding door effect, go and try it.
4. Sliding door example
The following example is used as homework. For details, please refer to the official website of Shanghai Shangxuetang http:/ /www.shsxt.com/
css html implementation of a simple calendar
The above is the detailed content of Realizing the sliding door effect of web pages based on HTML+CSS. For more information, please follow other related articles on the PHP Chinese website!

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics





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

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.

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

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

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

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

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

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