Introduction of CSS
Introduction of CSS
(Cascading Style Sheets)
Cascading Style Sheets, fondly referred to as CSS, is a simply designed
language intended to simplify the process of making web pages presentable.
CSS allows you to apply styles to web pages.
CSS enables you to do this independently of the HTML that makes up each
web page. It describes how a webpage should look: it prescribes colors,
fonts, spacing, and much more.
There are three types of CSS which are given below:
1) Inline CSS
2) Internal or Embedded CSS
3) External CSS
Inline CSS
Inline CSS contains the CSS property in the body section attached to the
element is known as inline CSS. This kind of style is specified within an
HTML tag using the style attribute.
CSS Code
Internal or Embedded CSS
This can be used when a single HTML document must be styled
uniquely. The CSS rule set should be within the HTML file in the head
section i.e. the CSS is embedded within the <style> tag inside the head
section of the HTML file.
CSS Code
Output
External CSS
External CSS contains separate CSS files that contain only style
properties with the help of tag attributes (For example class, id,
heading, … etc). CSS property is written in a separate file with a .css
extension and should be linked to the HTML document using
a link tag. It means that, for each element, style can be set only once
and will be applied across web pages.
CSS Code
The file given below contains CSS property. This file saves
with .css extension. For Ex: External.css
1) link tag
is used to link the external style sheet with the html webpage.
2) href attribute is used to specify the location of the external style sheet file.
CSS Code
No comments: