Introduction to CSS

What is CSS?

Cascading: Multiple styles can overlap in order to specify a range of style from a whole web site down to a unique element. Which style gets applied pertains to the rules of CSS cascading logic.

Style: CSS deals specifically with the Presentation domain of designing a web page (color, font, layout, etc).

Sheet: Normally, CSS is a file separate from the HTML file –linked to the HTML file through its <head> (exceptions apply).


Why CSS?

Allows for much richer document appearances than HTML.

Reduce workload by centralizing commands for visual appearance instead of scattered throughout the HTML doc.

  • Use same style on multiple pages.
  • Reduce page download size.
Basic Syntax

Made up of three parts:

selector {property: value}

The selector is normally the HTML element/tag you wish to define

The property is the attribute you wish to change Every property has the value If the value is multiple words, put quotes around the value
p {font-family: "sans serif"}

To make the style definitions more readable, you can describe one property on each line

p
{
text-align: center;
color: black;
font-family: arial
}

Reference CSS from HTML

Inline style
inside an HTML element
Internal style sheet
inside the <head> </head>tag
External style sheet
inside external *.css file


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