Latest Post

How to use for CSS

How to use for CSS

How to use for CSS


CSS stands for Cascading Style Sheets.

CSS is saves a lot of type. It can control the layout of multiple web pages all at once.

CSS can we added to HTML elements in 3 type:
  • Inline - by using the style attribute in HTML and PHP elements.
  • Internal - by using a start <style> and end </style> element in the <head> section.
  • External - by using an external CSS file.

Inline CSS

An inline CSS is used to apply a unique style to a single HTML and PHP element.
This example sets the text color of the <p> element to blue.

Example: 
<p style="color:blue;">This is a Blue Heading</p>


Internal CSS

An internal CSS is used to define a style for a single HTML and PHP  page.
An internal CSS is defined in the <head> section of an HTML page, within a start <style> and end </style>element:

Example: 
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: pink;}
p    {color: red;}
</style>
</head>
<body>

<p>This is a paragraph.</p>

</body>
</html>


External CSS

An external style sheet is used to define the style for one or many HTML and PHP pages.
To use an external stylesheet, add a link to it in the <head> section of the HTML and PHP page:

Example: 
<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>

<p>This is a paragraph.</p>

</body>
</html>

1 comment: