Problem with pop-up layer written in pure CSS_html/css_WEB-ITnose
I want to use a picture as a link. When the mouse moves over the picture, the corresponding layer will pop up under the picture. Similar to the Want Want customer service module on Taobao, when the mouse moves over the Want Want icon, the corresponding Want Want list will pop up below! Now I want to use CSS to write without JS code. I don’t know how to implement it. Is there any expert who knows about it and can give me some ideas? It’s best if they can give me an example! Thank you so much! Thanks!
Reply to the discussion (solution)
They are all written in js
I don’t know how to do it. It seems that it can be achieved using CSS hiding. Yes, but I don’t know how to operate it!
I don’t think it is possible with pure css. Anyway, I have never written it or seen it.
There is a pure CSS div pop-up menu in my resources for your reference.
I don’t know how to do it. It seems that it can be achieved using CSS hiding, but I don’t know how to do it!
You can use overflow:hidden and overflow:auto to switch between hiding and showing.
How to implement the code!
It can be implemented, but it will be too big. ,
You think the css is the css of the label, and each label has its own css. You can't control the style of the submenu with the css on the main menu, right? Right?
This can only be achieved through other methods. For example, the submenu is divided into two parts. The upper part covers the main menu and is transparent, and the lower part is the submenu function. At the beginning of debugging, the height of this layer is the same as the main menu. When the mouse moves above, the height of the layer is changed to the height of the main menu and submenu.
And your layer must be absolutely positioned, otherwise the submenu will be displayed and the content under the menu will be pushed downwards. This is ugly.
Just implement the code yourself.
Let’s use js to implement it. There is no need to complicate simple problems.
How is it possible to write it in css? ? ? I just wrote a jquery, take a look
</script> <script type="text/javascript"> $(document).ready(function(){ $(".flipa").click(function(){ $(".panela").slideToggle("slow"); }); }); $(document).ready(function(){ $(".flipb").click(function(){ $(".panelb").slideToggle("slow"); }); }); $(document).ready(function(){ $(".flipc").click(function(){ $(".panelc").slideToggle("slow"); }); }); $(document).ready(function(){ $(".flipd").click(function(){ $(".paneld").slideToggle("slow"); }); }); </script>
div.panela,.panelb,.panelc,.paneld,p.flipa,p.flipb,p.flipc,p.flipd { margin:0px; padding:5px; text-align:center; background:#e5eecc; border:solid 1px #c3c3c3; } div.panela,.panelb,.panelc,.paneld { width:220px; height:120px; display:none; } p.flipa,p.flipb,p.flipc,p.flipd { width:220px; height:20px; }
</div> <p>请输入密码:</p> <input type="password" id="pwd" /><p /> <div class="panela"> <p><a href="">百度一下</a></p> <p><a href="">百度一下</a></p> </div> <p class="flipa" id="a">请点A</p> <div class="panelb"> <p><a href="">百度一下</a></p> <p><a href="">百度一下</a></p> </div> <p class="flipb" id="b">请点B</p> <div class="panelc"> <p><a href="">百度一下</a></p> <p><a href="">百度一下</a></p> </div> <p class="flipc" id="c">请点C</p> <div class="paneld"> <p><a href="">百度一下</a></p> <p><a href="">百度一下</a></p> </div> <p class="flipd" id="d">请点D</p>
I am a newbie too! It’s so complicated to write!
Thanks! Learn from each other!
How can it be written in css? ? ? I just wrote a jquery code, take a look
JScript code

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

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

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

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.
