Development

CSS 태그 이해.

sonpro 2023. 3. 8. 00:10
반응형

CSS tags# Understanding of CSS Tags

CSS tags play a crucial role in styling web pages. They are used to define the appearance of HTML elements on a web page. CSS tags are used to apply styles to different elements such as text, images, and tables. In this blog post, we will explore the different types of CSS tags and how they work.

Types of CSS Tags

There are three types of CSS tags:

1. Selector Tags

Selector tags are used to select HTML elements on a web page. They are used to apply styles to specific elements on a web page. Selector tags can be classified into three types:

  • Element Selector: This selector targets HTML elements by their name. For example, to apply styles to all the paragraphs on a web page, we can use the p selector.

  • Class Selector: This selector targets HTML elements by their class name. For example, to apply styles to all the elements with the class name highlight, we can use the .highlight selector.

  • ID Selector: This selector targets HTML elements by their ID. For example, to apply styles to an element with the ID header, we can use the #header selector.

2. Property Tags

Property tags are used to define the style of an HTML element. They are used to set the color, font-size, background-color, and other styles of an element. Property tags can be classified into two types:

  • Standard Property: This property is used to set the standard styles of an HTML element. For example, to set the font-size of a paragraph, we can use the font-size property.

  • Custom Property: This property is used to set custom styles of an HTML element. For example, to set the background color of a paragraph to pink, we can use the --bg-color: pink property.

3. Value Tags

Value tags are used to define the value of a property. They are used to set the size, color, and other values of a property. Value tags can be classified into two types:

  • Fixed Value: This value is used to set a fixed value for a property. For example, to set the font-size of a paragraph to 16px, we can use the font-size: 16px value.

  • Relative Value: This value is used to set a value relative to the parent element. For example, to set the font-size of a paragraph to 1.2 times the font-size of the parent element, we can use the font-size: 1.2em value.

Conclusion

CSS tags are an essential part of web development. They are used to define the appearance of HTML elements on a web page. In this blog post, we explored the different types of CSS tags and how they work. We learned about selector tags, property tags, and value tags. By understanding these tags, we can create beautiful and responsive web pages.

반응형