Need of CSS
What is CSS
CSS stands for Cascading Style Sheets. It is a style sheet language which is used to describe the look and formatting of a document written in markup language. It provides an additional feature to HTML. It is generally used with HTML to change the style of web pages and user interfaces. It can also be used with any kind of XML documents including plain XML, SVG and XUL.
CSS is used along with HTML and JavaScript in most websites to create user interfaces for web applications and user interfaces for many mobile applications.
What does CSS do
Why use CSSThese are the three major benefits of CSS: 1) Solves a big problemBefore CSS, tags like font, color, background style, element alignments, border and size had to be repeated on every web page. This was a very long process. For example: If you are developing a large website where fonts and color information are added on every single page, it will be become a long and expensive process. CSS was created to solve this problem. It was a W3C recommendation. 2) Saves a lot of time CSS style definitions are saved in external CSS files so it is possible to change the entire website by changing just one file. 3) Provide more attributesCSS provides more detailed attributes than plain HTML to define the look and feel of the website. How to add CSSCSS is added to HTML pages to format the document according to information in the style sheet. There are three ways to insert CSS in HTML documents.
1) Inline CSSInline CSS is used to apply CSS on a single line or element. 2) Internal CSSInternal CSS is used to apply CSS on a single document or page. It can affect all the elements of the page. It is written inside the style tag within head section of html. 3) External CSSExternal CSS is used to apply CSS on multiple pages or all pages. Here, we write all the CSS code in a css file. Its extension must be .css for example style.css. |
Comments
Post a Comment