CSS Modify drop-down list select default Style instance

Source: Internet
Author: User

Some of the default styles of select are difficult for us to modify and replace with the label. Now let's talk about how to modify these default styles, I hope this article can help everyone.

Add parent element p to select to overwrite the Select style with the style of P.

CSS code:

        p{//Use the style of p to replace the style of select width:200px;            height:40px;            border-radius:5px;            The box shade modifies the function, oneself arbitrarily box-shadow:0 0 5px #ccc;        position:relative;            } select{//Clear the Border style of select Border:none;            Clears the border color of the select focus time Outline:none;            The width height of the select is equal to the width height of p width:100%;            height:40px;            line-height:40px;            Hides the drop-down icon for select Appearance:none;            -webkit-appearance:none;            -moz-appearance:none;        The text is centered padding-left:60px by padding-left value;            }//Use Pseudo-class to add to select the icon you want to use p:after{content: "";            width:14px;            height:8px;            Background:url (img/xiala.png) no-repeat Center;            Place the icon in the appropriate position by positioning Position:absolute;            right:20px;            top:45%; To customize the icon to achieve the click Down function pointer-events:nOne }

Some of the default styles of the

Select are difficult for us to modify, and replace the labels. Now let's talk about how to modify these default styles: HTML code:

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.