Get the App
SLTechnology News&Howtos  ›  Development  › 

There are several ways to annotate css

Shulou Source: shulou.com Published: 2022-06-03 14:16:18 10月02日 Update

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!

Tags: Comments fonts styles effects paragraphs colors content examples methods between code text more headings knowledge web pages boldface practical learned next Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia OPPO Reno Microsoft Docker MariaDB