About CSS.
CSS, alongside HTML and Javascript, is one of the three main languages that make up the modern internet. CSS stands for Cascading Style Sheets and is responsible for the aesthetic and visual aspects of a webpage. It works in tandem with the HTML, reading the data provided by it, and applying formatting rules and modifications to them, before presenting them to the visitor via their web browser.
Selectors:
A Selector is a segment of CSS code that states what HTML element is about to be modified. <h1>
is a module in HTML. If we apply formatting rules such as
<h1> {color: Blue;}
then the <h1>
in the CSS is our Selector.
Declarations, Properties, and Values.
-
Going back to the above example, a Declaration is the full text of
<h1> {color: Blue;}
, since we are declaring that “Any text within H1 tags in our HTML document should be changed to the color blue” -
A Property is an aspect of the contents of
<h1>
that can be modified, that we would like to. Examples include, as in our case,color
, along with font, fontsize, background color, and many others. -
a Value is the argument that we are passing to our Property. Properties can accept, depending on what they are, numerous different values that it may apply. In our example, the value of our Property
color
isblue
. For the propertyfont-size
an example value may be28
. Note that some properties may allow a variety of formats for values,color
for example will allow names such asblack
, or color value hex codes such as#00FFAB
, or direct RGB values, such asrgb(0,255,171)
.