Use HTML5 and CSS3 to create a modal box, html5css3

Source: Internet
Author: User
Tags transparent color

Use HTML5 and CSS3 to create a modal box, html5css3

This article describes how to use HTML5 and CSS3 to create a modal box and share it with you as follows:

Source code example

Maybe you don't want to see a bunch of lengthy descriptions below, but you want to directly view the source code or an online example. The following link is a functional modal box created using attributes such as transition (transition), opacity (opacity), pointer-event (pointer event) of CSS3.

You can click it to go to Github to view the source code: ModalBox-Tutorial

HTML Structure

The front-end components are all driven by business and interaction scenarios, and the modal boxes are no exception. A common scenario is to perform an operation, such as clicking a button and displaying a modal box, feedback to the user or guide the user to perform the next interaction. The interaction of a modal box may take five steps:

1. You can click a button or link to trigger the display of the modal box;

2. When the modal box is displayed, there will be a transparent mask layer to block the current entire view;

3. The content of the modal box will appear in a non-transparent color (usually white) in a certain position (usually in the middle) in the viewport );

4. The content of the modal box (usually in the upper right corner) has a "close" sign. Clicking it will hide the modal box;

5. The content of the modal box should be specified according to the actual business scenario, so it can be any structure.

Style

1. modalbox was originally hidden;

1. modalbox is a transparent mask layer;

2. modalbox-dialog is a non-transparent content layer;

3. Click the link of the show modal box. modalbox will be displayed;

4. Click. modalbox-close-btn. modalbox will be hidden;

Result example

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.