SETTING UP CSS FOR DUMMIES
A QUICK REMINDER: WHAT IS CSS FOR?
It is the one that allows you to choose the color of your text. It allows you to select the font used on your site and to define the size of the text, the borders, the background…And also, it is the one that allows you to make the layout of your site. You can say: I want my menu to be on the left and occupy such a wide space, the header of my site to be positioned at the top and always visible, etc.
CSS IS ABOUT THE STYLE
In general, with CSS, you use the markup language to describe the information contained in the document, not its style. CSS is used to specify its style and not its content. A markup language such as HTML also provides some ways to specify a style. For example, in HTML, it is possible to use a tag <B> to make text bold, or to specify the background color of a page in its tag <BODY>. When using CSS, we generally avoid using these possibilities of the markup language so that all the style information of the document is in the same place. More about this subject on webmaster-site-design.com.
WHY AND HOW TO USE CSS VARIABLES?
CSS VARIABLES: EASIER TO READ AND MAINTAIN
First of all, the use of CSS variables makes it easier to read. Who knows what “#3f6aea” means? Not many people apart from the webdesigner, webmaster or digital marketing professional you know! On the other hand, if I record this hexadecimal value in a variable called “royal blue”, it is much easier to understand what it corresponds to.
The second and perhaps most important point concerns maintenance. Indeed, on the day you would like to use a slightly different royal blue, you will have to replace each line indicating “#3f6aea” with the new hexadecimal chosen. On the other hand, if you have stored it in a variable, you only need to modify the value of the variable to make the changes everywhere.
PAGES LOAD FASTER AND USE LESS BANDWIDTH
Style sheets (downloaded only once and then stored in the cache memory) simplify the HTML code, which allows you to use less bandwidth when loading the page.
CSS IS COMPATIBLE WITH ALL BROWSERS
Websites that correctly use CSS have a similar appearance regardless of the browser used which is great for Web developers using different platforms to navigate.
CSS ALLOWS THE USER TO CUSTOMIZE A WEB PAGE
Today, many websites allow the user to change the layout of a site without changing the content. The style sheets that are stored externally allow that allow users to make the changes by themselves.
MORE ADVANTAGES OF USING CSS SHEETS
WHY LEARN TO CODE IN CSS?
CONTENT AND DESIGN FOR SEO
CSS allows you to modify the location of content on a page. Thus, it is possible to adapt their positioning to appeal to search engines, which focus more on the text at the top of a page. But be careful not to exaggerate, we remind you that the content must have a Perfectdesign for the user: placing a text block on the top of each page will certainly be good for robots, but less so for Internet users.
CSS ERRORS TO AVOID FOR SEO
While CSS allows many possibilities, not all of them are good to take (even if they seem tempting) at the risk of harming natural SEO. For example, choosing to hide content, for example, is particularly driven out by Google, which could consider the site as SPAM and punish it on its natural SEO. Creating a code file full of keywords and making it visible only to search engines is therefore not a good option!