Why do we need CSS?
The purpose of using CSS is to make Web pages have beautiful and consistent pages, the other most important reason is that the content and format separation before the CSS, we want to modify the style of HTML elements need to define the style attributes for each HTML element, when the HTML content is very long, it will define a lot of repeating style properties , and the changes need to be modified one by one, with painstaking effort. It's time to make a change, so the CSS is there.
The advent of CSS solves the following two issues:
- Separates the contents of an HTML page from the style.
- Improve the productivity of web development.
what is CSS?
- CSS refers to cascading style sheets (cascading style Sheets)
- Style defines how HTML elements are displayed
- Styles are typically stored in style sheets
- Add a style to HTML 4.0 to solve the problem of separating content from performance
- external style sheets can greatly improve productivity
- External style sheets are typically stored in CSS files
- Multiple style definitions can Cascade to a
Advantages of CSS
1. Separation of content and performance
2. Web page performance is unified, easy to modify
3. Rich style, make the page layout more flexible
4. Reduce the amount of Web page code, increase the speed of web browser, save network bandwidth
5. The use of the independent page of CSS, conducive to Web pages indexed by search engines
How do I use CSS?
We usually keep the content of the style rule in a CSS file, which is called an external style sheet, and then the CSS file is referenced in the HTML file by link the tag. The browser loads the CSS file as it resolves to the link tag and renders the HTML file according to the style rules in the file.
Front End Development-css Introduction