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

There are several ways to annotate css

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces the relevant knowledge of "there are several annotation methods of css". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

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

Adding comments to CSS is simple, and all text messages placed between the / * and * / delimiters are called comments.

CSS has only one kind of comment, whether multiline comment or single-line comment, must start with / * and end with * /, with comments in the middle.

Any character contained between the / * and * / symbols is ignored as comment text.

[example 1] comments are placed outside the stylesheet.

/ * define the header style of the web page * / .head {width:960px;} / * define the bottom style of the web page * / .footer {width:960px;}

[example 2] comments are placed inside the stylesheet.

P {color: # ff7000; / * font color setting * / height:30px; / * paragraph height setting * /}

The following example applies the CSS code and looks at the effect under the browser.

[example 3] add CSS code comments for paragraphs and headings, respectively.

/ * style 1*/.STYLE1 {color: # 009900; / * font color is green * /} / * style 2*/.STYLE2 {font-size: 18px; / * font size is 18-point font * / color: # FF3300; / * font color is red * / font-weight: bold; / * font is bold * /} / * style 3*/.STYLE3 {color: # 0000FF / * the font color is blue * / font-family: "boldface"; / * the font is boldface * / font-style: italic; / * the font effect is tilted * /} paragraph setting one

Paragraph setting two

Title setting effect

The demo effect of the page is shown in the following figure.

This is the end of the content of "several ways to annotate css". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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