The process of teaching web design begins with the question of what CSS is. After all, this language allows you to completely change the appearance of your documents. Offering a competent alternative to the obsolete tags used in the usual hypertext language, CSS allows you to flexibly customize all the relevant parts of the page. The World Wide Web Consortium recommends using cascading style sheets to determine the design of web documents. In this article, you will learn what CSS is and where it is applied.
Definition
CSS is an abbreviation of English Cascading Style Sheets, which translates into Russian means "cascading style sheets." As such, a separate programming language cannot be considered CSS, since it does not matter without documents built on HTML or XHTML.
CSS styles are inextricably linked to web pages. The modern World Wide Web would have been too dull and inconspicuous without these very tables. They allow you to make unique changes and make an incredible page design using a fairly simple language. CSS was published in 1996, and has since been very popular since there is no logical replacement for these stylesheets. All files written in this language have the extension .css.
When creating cascading style sheets, developers tried to simplify the work of web designers as much as possible. At the same time, the main goal was set: to separate the logical structure of the document, which is controlled using HTML or XHTML, and to describe the appearance. Cascading style sheets allow you to change the font, color, background, position of elements, intervals, and much more.
Essence
CSS styles are built on an extremely simple principle. There are no complicated rules and abstruse terms. It is enough to select the desired element and assign the necessary property to it. That is, you can take the <p> tag and change the font and color of the characters that are inside it. In this case, each such element of the document will be assigned this property. There is no need to assign a value to all tags separately. You can use wider goals, for example, immediately assign a property to the entire document by defining a property to the "body" element. Or stylize a single fragment through special id-identifiers or selectors.
Application
There are three ways to use cascading styles:
- At the document level. You can assign a short entry in the tag itself. This option is best used when there is no need to repeat this style.
- Inside the document. If you have a one-page site, you can easily enter cascading table rules at the top of the document. In this case, all definitions are placed in the <style> tag, which is included in the <head>.
- Separately. That is why this language was created. If you have many pages or even sites that use the same design, you can attach one CSS file to each document, which will determine the style. Binding is done using the <link> tag.
Conclusion
Whole books are devoted to the question of what CSS is, seminars are held. And, of course, it is impossible to fully disclose this topic in one article. To fully master this language, you need to spend a lot of time. But a positive result will be required. Therefore, do not be shy and more often ask yourself what CSS is, and after a fascinating study you can create your own style.