Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does css call class

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report