Technology

What is CSS and how does it work?

2023-09-19 03:43:27


What is CSS and how does it work?

Cascading Style Sheets (CSS) is a language used to style web pages. It works with HTML. CSS was developed in 1996 by the W3C (World Wide Web Consortium) to solve the problem of web pages having different fonts, colors, backgrounds, and layout styles because HTML was not designed to tag tags. Come help in formatting the web page, divided into 3 types.


CSS workflow

CSS can work by using English to write simple commands as a set of commands. It works with HTML as follows:



< HTML header > followed by the CSS section after the { } brackets, such as {color: red; font-size:12px;} in the display, it will be displayed according to the CSS values that we set.


Types of CSS

1. Inline CSS is code that is embedded into the Teg line of HTML, which will cause data or objects that contain Teg that uses CSS to be displayed as coded, such as setting color values.



As shown in the picture, Teg values are set: <body> is blue and

title is green. When

is opened again, it will still follow the color values that we set. In addition, we can configure many different values.


2. Internal or embedded CSS is code that is written together with HTML code, in which the code is in the same section, such as





3. External CSS is the code used to store separate files outside of the website file, which works by Linking and Importing, such as

  • A link type is a link to another website.

  • import type



strength

  • Make web pages beautiful
  • Reduce the amount of code re-write
  • Can customize files
  • Save server space
Leave a comment :