Home >Web Front-end >CSS Tutorial >What is used to connect classes in css3

What is used to connect classes in css3

WBOY
WBOYOriginal
2021-12-23 17:30:222102browse

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;}".

What is used to connect classes in css3

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:

What is used to connect classes in css3

##(Learning video sharing:

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn