CSS is a style sheet of HTML documents, It stands for Cascading Style Sheets. It uses to describe how the appearance of the web page colors, layout, fonts or to be display of the HTML web pages.
To help you understand how it will help to describe the HTML page, we will show you one demo with and without the CSS. On the left-hand side, CSS does a great job to make our web page looks better. But when we remove the CSS from the website, it turn out became a simple document with no design.
Why and When Uses CSS
As the website has grown, we will have difference kind of electronic devices like PC, tablet and mobile phone that comes with difference size of screen. The HTML document might be bad for some device that have a very small or very big size of screen. As you can see the demo above, the image size are exceed over the screen size. But with CSS, we can fit the image with the right size. This is why we need CSS to do the job and fit the right image size for difference screen sizes.
Advantages of CSS
- Easy to maintain – Unlike HTML attributes, CSS is easier to maintain. You can make a global change of the site, single page or even single element with CSS. It’s going to save you a ton of time!
- Widely supported – Web development has been evolved for decades, there are many HTML attributes are deprecated. While CSS is still compatible to all the browsers.
- Faster – You can write one CSS class and reusing them to all the required documents. If you use HTML attributes, the code can be very long because you need you will need to set all the HTML attributes of each element. But CSS can do it globally by adding the
idto the HTML element.
Founder of CSS
- Håkon Wium Lie
- Bert Bos
- Worldwide Web Consortium
- CSS 1 (1996)
- CSS 2 (1998)
- CSS 3 (2005)