HTML CSS


❮ Previous Next ❯

What is an HTML CSS?

CSS Stands for Cascading Style Sheets.
It is used to design the layout of a webpage
It can control the layout designs of multiple webpages in a single sheets. CSS control the colors, font or font sizes, text colors, background images or colors, display position of the content, control screen sizes of diffrent devices, and others visual aspects.
CSS can be used in three ways as given below with examples.

Inline CSS

Inline CSS is used to apply a different styles to a single HTML element by using style attribute.

Example

<p style="background-color:green;">The background color is GREEN.</p>
<p style="background-color:orange; color:white;">The BACKGROUND color is ORANGE and the TEXT color is WHITE.</p>
<p style="border:5px solid blue;">The BORDER color is BLUE.</p>
Try It »

Internal CSS

Internal CSS is used to apply a single HTML webpage by using <style> attribute.
It is placed in the <head> section of an HTML document.

Example

<style>
h1 { color:red; }
p { color:blue; }
</style>
<h1> H1 is in Red Color</h1>
<p>Paragraph text is in blue color </p>
Try It »

External CSS

External CSS is an style sheet which is used to define the styles of multiple webpages.
External style can be used by adding a link to it in the <head> section of all HTML page.

Example

<link rel="stylesheet" href="external-stylesheet.css">
<p>Design of this text mention in the external stylesheet</p>
Try It »