In CSS3, you can use the ".class" selector to connect to class. This selector is used to select elements with a specified class (class). After selecting the specified element, you can set the style of the selected element. The syntax is: ".class{css style code;}".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
What is used to connect class in css3
.class selector selects elements with a specified class (class).
Class selectors allow styles to be specified in a way that is independent of document elements.
This selector can be used alone or in combination with other elements.
Tip: These selectors can only be used after the document has been properly marked up, so using either selector usually requires some thought and planning.
To apply styles regardless of the specific design element, the most common way is to use a class selector.
The .class selector specifies the style of all elements of the class.
The example is as follows:
<html> <head> <style> .intro { background-color:yellow; } </style> </head> <body> <h1>Welcome to My Homepage</h1> <div class="intro"> <p>My name is Donald.</p> <p>I live in Duckburg.</p> </div> <p>My best friend is Mickey.</p> </body> </html>
Output result:
css video tutorial)
The above is the detailed content of What is used to connect classes in css3. For more information, please follow other related articles on the PHP Chinese website!