Coding With Cascading Style Sheets
What is CSS3?
What is CSS3?
Once the coder becomes somewhat familiar with HTML5 and has built a few HTML files, she will likely explore CSS3. The style sheet is, in fact, linked to web pages with a line of HTML that reads: <link rel="stylesheet" type="text/css" href="TheStyle.css"> Here, the name of the CSS file is TheStyle.css, and yes, we must save our CSS files with the extension .css, just as we save our HTML files with the .html extension.
The first to know before coding is that you will be using a text editor, just as you did with HTML coding. A useful and free one is Notepad++. However, you can use whichever text editor that you are comfortable with. I used Sublime text in the example I provided. In your CSS learning, you will undoubtedly observe hexadecimal notation. Hexadecimal notation enables a fuller range of colors to be displayed. The problem with regular numbers is there is only ten of them (i.e., 0-9). Thus, the letters A through F were added, so there are up to 16 possible values for each digit. And there are 6 possible digit combinations for each color. The first two are red, next two green, last two blue. And 0 is the darkest, F the brightest. #000000 is black, #FFFFFF is white. And since the first two digits are for red, #FF0000 is red. But no need to memorize them, the values are easily found with a Google search.
Example of External Style Sheet
Why the Name?
If you are wondering why they are called Cascading Style Sheets, the cascading is a metaphor. For instance, if you connect 5 web pages to the same external style sheet ‘TheStyle.css’ and change the background-color from red to green on that one sheet, the background-color on all five pages changes to green. A cascade of change.
In conclusion, this is a mere introduction to CSS3. To actually learn it, you need to find some coding books and Internet sources and consistently practice. It, after all, takes time. And, obviously, you need to determine why--or whether--you want to devote your time to the project. After all, despite all the books promising you can learn CSS in a day, it takes a lot longer. That said, I found it a challenging and rewarding experience. Up for the challenge?