WHAT IS CSS?
This entry was posted on Tuesday November 30, 2021CSS represents Cascading Style Sheet. Where HTML is the thing that characterizes the construction and content of a site page, a Cascading Style Sheet is a web record that permits you to change the presence of the HTML.
CSS permits you to change the size, style, text style, and shade of text; edges and cushioning; foundation tones and line styles. It can likewise be utilized to situate components on a page (however we’ll leave that for one more day).
ONE BIG ADVANTAGE OF CSS IS CONSISTENCY
The best thing about CSS is that is permits you to make worldwide style changes that influence each occurrence of a specific component all through your blog or site so you don’t need to roll out these improvements at the singular page level. This saves you a huge load of opportunity with regards to upgrading your blog.
Here is an illustration of what I mean: as we learned last week, the page title on a blog page is characterized by a HTML component called a H1 (heading 1). Of course, the program shows a H1 as additional huge, striking, dark text, similar as we found in the PAWS model.
Assuming we need to change the shading, textual style and size of all the H1’s on our blog to keep consistency all through, you should simply characterize what all H1’s will resemble in your CSS.
At times various programs might show marginally unique default styles. Utilizing a template to characterize what a particular component ought to resemble can keep the vibe of your blog steady starting with one program then onto the next just as one gadget to another.
HOW DOES CSS WORK?
THE CASCADE
A vital piece of CSS is the “Falling” part. The program peruses style definitions start to finish in a template. This implies that a style you characterize lower in the template will abrogate any past styles characterized before in the template.
You can likewise have a template abrogate another template. This is the manner by which we can supersede predefined styles from our blog subjects or module gadgets, as our custom template is typically the last one read by the program.
HOW CSS IS APPLIED
CSS is applied to HTML elements in a web page by declaring specific styles for each element. A style declaration looks like this
selector {
property: value;
}
CSS CLASSES
Presently suppose you didn’t need specific pictures on your page to have a line on them, similar to your symbols for instance. We can add a class to those components in the HTML to explicitly target them. We add a class like this:
<img src=”image/twitter-icon.png” class=”icons”/>
Note that there are NO spaces between the word class, the equivalent sign, or the twofold statements.
You can name a class anything you desire, you simply need to name it something that bodes well. Likewise note that there are never any spaces in class names.
In CSS, all class names start with a dab. Presently we return into the CSS and add the accompanying after the past picture style (characterized above) so that it’s abrogated:
.symbols {
line: none;
}
This will advise the program to just apply this style announcement to picture labels with the class “symbols” added to it.
You can really add this class to any HTML component that you don’t need a line around.