Css close button implementation, css close button

Source: Internet
Author: User

Css close button implementation, css close button

It is implemented through the pseudo elements of css: before,: after and transform: rotate (45deg); rotation (IE9 and later versions are supported)

<Div class = "close"> </div>
/* Close the icon */. close {position: absolute; right:-25px; top:-25px; width: 50px; height: 50px; background: silver; border-radius: 25px; box-shadow: 2px 2px 5px 0px black; cursor: pointer ;}. close: hover {background: red ;}. close: before {position: absolute; content: ''; width: 30px; height: 10px; background: white; transform: rotate (45deg); top: 20px; left: 10px ;}. close: after {content: ''; position: absolute; width: 30px; height: 10px; background: white; transform: rotate (-45deg); top: 20px; left: 10px ;}

:

 

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.