What is CSS?

SEOSIKHO 22:48:00

CSS 


  • It is Called Cascading Style Sheet.
  • It is used to format the layout of webpage.
  • There are three type of CSS 
  1. Internal
  2. External
  3. In line 

  1. In line 

  • An inline style may be used to apply a unique style for a single element.
  • To use inline styles, add the style attribute to the relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a <h1> element:
example:


<!DOCTYPE html>

<html>
<body>

<p style="font-family:verdana; color:black; background-color:red;">Hello Everone .</p>


</body>
</html> 

Output: 

Hello Everone .

Internal Style sheet

 all elements are defined in style element normally in head part.

■ This method has the second highest priority among three methods.

■ id attribute of the element to be styled is used to mention it in style element.

Syntax

<style type= "text/css">
#id{css code;}

</style>

Example:


<html>
<head>

<style>
p{background-color:pink;}
</style>
</head>

<body>
<p>Notepad is a basic text-editing program and it's most commonly used to view or edit text files. A text file is a file type typically identified by the .txt file name extension.
</p>

</body>
</html>


Output: 







TAG:  













Share this

Related Posts

Previous
Next Post »