Get the App
SLTechnology News&Howtos  ›  Development  › 

How does css call class

Shulou Source: shulou.com Published: 2022-06-02 10:43:30 10月01日 Update

Editor to share with you how css calls class, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

In css, you can use the ".class" selector to call class, which is used to select the element with the specified class attribute, with the syntax of ".class attribute value {css style code;}".

The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 computer.

We usually use class to choose to call the CSS style attribute when making web pages. For beginners learning CSS, the use of class is not very familiar, so let's give a brief introduction.

Class is called "class" in the program, and it is also called "class" in CSS. The lowercase "dot" and "." in the CSS style To name things such as: .top {attribute: attribute value;}.

That is, the. "class selector selects the element with the specified class (class).

In the html page, use class= "top" to select the call, such as: .top {attribute: attribute value;}, called in html as here is the text

Examples are as follows:

.intro {background-color:yellow;} Welcome to my home page

I'm Donald Duck.

I live in Duckburg.

My best friend is Mickey Mouse.

Output result:

As you can see, the specified class can be called through the ".class" selector to execute the specified css style.

Note:

These are the simplest css, hope to be helpful to beginners.

The above is all the content of the article "how to call class by css". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Attributes selections styles articles elements content pages learning help normal not much home page that is written written items code beginners at the same time Donald Duck Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology vpn Microsoft Shulou Information MariaDB