css inside css code example

Example 1: add css file to html

/*
Adding css file into html document
*/

<link rel="stylesheet" type="text/css" href="yourstylesheetname.css">  /* add this line into head tag of the file with change in file name. */

/*
I hope it will help you.
Namaste
*/

Example 2: link css file in html

<link rel="stylesheet" href="styles.css">

Example 3: how to link css to html

<link rel="stylesheet" href="PathToYourFile.css">

Example 4: how to write css in html

<p style="color: blue; font-size: 46px;">

Example 5: descendent selector in css

The descendant combinator — typically represented by a single space ( ) 
character — combines two selectors such that elements matched by the second
selector are selected if they have an ancestor 
(parent, parent's parent, parent's parent's parent, etc) 
element matching the first selector. 

example: 
  h1 ul {
    border : 1px solid #f1f1f1;
}
Explanation: This above CSS code snippet will select all the 'ul' (unordered list)
			 tags which are preceeded by an 'h1' (header tag).
/*the best way to understand is to practice by implemetation.
Create a html file with lots of h1 and ul elements to understand by
implementing CSS on them*/

Tags:

Misc Example