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

What are the basic rules of CSS grammar

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly shows you "what are the basic rules of CSS grammar". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "what are the basic rules of CSS grammar?"

CSS Syntax 1. Basic rules

The CSS rule mainly consists of two parts: the selector and the declarations.

A selector is a HTML element that developers want to change their style.

A declarations is an element rule that developers want HTML to change. It can be one or more.

Each declaration (declarations) consists of an attribute (property) and a value (value).

The property is the style attribute that the developer wants to set.

The value is the specific content of the attribute.

Properties and values are separated by colons, and declarations are directly separated by semicolons.

Comments in CSS begin with / * and end with * /.

/ * selector {property: value} * / H2 {color:red; font-size:14px;}

The above line of code defines the text color within the H2 element as red and sets the font size to 14 pixels.

These are all the contents of the article "what are the basic rules of CSS Grammar". 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