Types of CSS

Types of CSS


  • Inline style
  • Internal style sheet
  • External style sheet


Inline style

<tag_name style=“Property_Name:Value; “>

Example:

<P style=“Font-size:18px;”>
text
</p>
Internal style sheet

<head>
<style type="text/css">
selector{
Property : value;
Property : value;
}
</style>
</head>

Example:

<html>
<head>
<style type="text/css">
h1 {color: green}
h2 {color: #dda0dd}
p {color: rgb(0,0,255)}
</style>
</head>
<body>
<h1>This is header 1</h1>
<h2>This is header 2</h2>
<p>This is a paragraph</p>
</body>
</html>
External CSS:

Create a .css file that contain the only css script and link it into .html or . php page based on requirement.

<head>
<link type=”text/css” rel=”stylesheet” href=”css_filename.css”>
</head>

Example:

File name Style.css

P
{
Color:red;
}

Html file:

<html>
<head>
<link type=”text/css” rel=”stylesheet” href=”style.css”>
</head>
<body>
<p>cs-tutorial is a best website for html tutorial</p>
</body>
</html>
Qus. 1 : Which is not a valid CSS type?

  1. Inline
  2. External
  3. Outline
  4. Embedded (Internal)
Qus. 2 : What is not true about External Style sheet?

  1. It is a separate document that contains CSS rules
  2. It separates content from the presentation but both are still contained in a single file
  3. It separates the content and style into separate files
  4. It allows a web designer and a content author to work in parallel

Programs

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad