What is CSS? Explain different types of CSS?
CSS stands for Cascading Style Sheet. It describes Html elements to be
displayed at which part of the page. And how to appear like color, design,
layout, size, border, and margin, etc.
CSS describes how HTML elements are to be displayed on screen, paper,
or in other media
CSS saves a lot of work. It can control the layout of multiple web pages
all at once
External stylesheets are stored in CSS files
There are 3 types of CSS: Inline CSS, Internal/ Embedded CSS,
and External CSS.
Inline CSS
Inline CSS allows you to apply a unique style to one HTML
element at a time.
Using style attribute with any CSS properties defined within the element you
can assign a specific HTML element.
Syntax:
<htmltag style="cssproperty1:value; cssproperty2:value;"> </htmltag>
Inline CSS is not recommended as it may lead to messy code
<p style="color: Gray;">Hello World</p>
Internal/ Embedded CSS
The internal CSS styling is used for applying properties to individual pages by
wrapping all styles in the <style> element.
This is placed in the <head> section of HTML documents.
Syntax:
This is used for single-page websites or when we cannot create external
stylesheets for our project.
External CSS
External CSS is used to upload all styling properties and values to a separate
.css file.
Then, we have to link the CSS document to our HTML file using the link tag
in the HTML file.
Syntax:
The. .css file cannot contain HTML tags.
File: custom.css