Main advantages of using CSS
CSS (Cascading Style Sheets) are documents that allow us to define the styles we will use in our website. In this way, the designer and programmer can work separately without interfering each other. Even though, they will need to work in parallel when defining styles and formats.
This are the main advantages of using CSS when programming a webpage:
-
Unifying format
As we extend the size of our Web Site, being able to centralise and unify all the styles in one single document will help us being consistent in styles and format. CSS enables for making any change in the CSS file, which will automatically affect all the pages linked to it.
-
Loads Centralising
The fact of using one single style document for the whole website will optimise the loading time of our website, since this will only need to load once, saving in the cache's memory.
-
Flexibility
With CSS files, we can change, in an easy and simultaneous way, one part or the whole website design. We will just need to modify the style sheet, without updating the content.
-
Precision
CSS will help us with the position and size of size of the elements to make they look precise. We will be able to tell the browser which pixel it has to place an image in, as well as the exact size. We can also use relative sizes to allow us expand or reduce any object's size to adjust it to the browsing screen independently on the resolution.
-
Simplicity
Just with writing an independent style sheet, avoiding to write the style of every page's style in the coding document, will simplify the web-s code. This will make the error detection easier and quicker.
-
Standard
CSS has been aproved by W3C Standard, which ensures our website will be compatible and visible through different browsers (Firefox, Chrome, Microsoft Edge, Opera…).