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 Bootstrap CSS syntax coding specifications

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "what are the Bootstrap CSS syntax coding specifications". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deep into it slowly to study and learn "what are the Bootstrap CSS syntax coding specifications" together!

1. Replace the tab with two spaces-this is the only way to guarantee consistent presentation in all environments.

2. When grouping selectors, place individual selectors on a single row.

3. For code legibility, add a space before the left curly brace of each declaration block.

4. The right curly bracket of the declaration block should be in a separate row.

5. Each declaration statement should be followed by a space.

6. For more accurate error reporting, each statement should have a separate line.

All declarations should end with a semicolon. The semicolon after the last declaration statement is optional, but if you omit it, your code may be more error-prone.

8. For attribute values separated by commas, insert a space after each comma (for example, box-shadow).

9. Do not insert spaces after commas inside rgb(), rgba(), hsl(), hsla(), or rect() values. This helps to distinguish multiple color values (commas only, no spaces) from multiple attribute values (commas and spaces only).

11. For attribute values or color parameters, omit the leading zeros for fractions less than 1 (for example,.5 instead of 0.5;-.5px instead of-0.5px).

Hexadecimal values should be all lowercase, for example,#fff. When scanning documents, lowercase characters are easy to distinguish because their form is easier to distinguish.

13. Try to use hexadecimal values in shorthand form, for example,#fff instead of #ffff.

14. Add double quotes to attributes in selectors, for example, input[type="text"]. Optional only in some cases, but for code consistency it is recommended to include double quotes.

15. Avoid specifying units for 0 values, for example, by using margin: 0; instead of margin: 0px;.

Thank you for reading, the above is "Bootstrap CSS syntax coding specification what" content, after the study of this article, I believe we have a deeper understanding of Bootstrap CSS syntax coding specification what this problem, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

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