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 three ways to introduce css?

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

Share

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

This article mainly introduces the relevant knowledge of "what are the three ways to introduce css". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "what are the three ways to introduce css" can help you solve the problem.

There are three ways to introduce css

1. Row introduction is a preferred way to html, but it has great limitations. It works in the label. Eg:+ action object +

.

2. Internal introduction, tag selector, ID selector and class selector are all internal introduction, that is to say, three ways of internal introduction.

In the tag selector eg:css, p {color:red;}

Id selector eg: in html, in css, it is, # A word {color:red;}

# A sentence {color:blue;}

The class selector was mentioned above.

3. External introduction

The format is

This kind of introduction lacks example practice.

Css Common Properties

Width: sets the width of an element

Height: sets the height of an element

Text attribute

Font-size: sets the size of the text to be numeric, in pixels (commonly used)

Color: set the color of the text to either the English name of the color or the hexadecimal value

Font-weight: set font bold value 100,900 bold (common value) normal (default)

Font-style: set font tilt value normal (normal): default italic: set text tilt

Font-family: set font style value is font name normally set font must be installed on the computer

Text-decoration: set the text decoration as follows

None: the default value has no decorative effect

Underline: setting underline

Overline: setting overline

Line-through: setting delete line

Text-align: sets the location of the text left (default), center, right

Line-height: sets the line height of the text. The text is centered vertically based on the line height. Without setting the line height, the default line height is 1.2 times the font size.

Text-indent: set text indentation value in em. 1em is exactly equal to the width of 1 Chinese character.

Label classification

1. Inline tags: do not occupy a single line, but cannot set width and height

Inline tags: a, text labels, span, etc.

2. Block-level tags: occupy a single line, but can set width and height

Block-level tags: h class tags, p, list class tags, tables, etc.

Img: both in-line and block-level (that is, width and height can be set on one line)

Conversion between inline elements and block-level elements:

Convert to each other through display attributes

1. Inline conversion to block level: display:block

2. Convert block level to inline: display:inline

3. Convert to both inline and block level: display:inline-block

4. Display:none sets the current element to hide

This is the end of the introduction of "what are the three ways to introduce css". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

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