How to add css style to select
Today I want to show you how to add CSS style to select. The content of the article Xiaobian think good, now to share with you, think there is a need for friends can understand, hope to help everyone, the following with the idea of Xiaobian to read together.
Add method: 1. Add id or class attribute to select tag and set attribute value;2. Embed style tag pair in head tag pair;3. Use "#id value {css attribute: value;}" or ".class value {css attribute: value;}" statement to add css style in style tag pair.
Operating environment of this tutorial: Windows 7 system, CSS3 && HTML5 version, Dell G3 computer.
Add css style to select in html
Add id or class attribute to select tag and set attribute value
In the style tag pair, select the select element and set the style using the id or class selector
Implementation code:
#select{ background-color: #000000; color: white; width: 100px; height: 30px; } .select{ background-color: pink; color: white; width: 100px; height: 30px; } Volvo Saab Opel Audi Volvo Saab Opel Audi
Make a statement. 3. External style, where the link style is the most frequently used and most practical style, only need to add between
That's it. The second is to import style, import style and link style are similar, use @import style to import CSS style sheet, not recommended. The basic syntax of CSS is: 1. CSS rules consist of two parts: a selector and one or more declarations;2. Selectors are usually HTML elements that need to be styled;3. Each declaration consists of an attribute and a value;4. Attributes and attribute values are separated by colons.
The above is how to add css style to select all the content, more and how to add css style to select related content can be searched before the article or browse the following article to learn ha! I believe that Xiaobian will add more knowledge to everyone, I hope you can support it!