HTML & CSS WORKBOOK Q=3 1) What is external style sheet? What is the advantages of using external style sheet? Ans : An external style sheet is separate file containing the CSS code and has to be saved with the file extension .css. It cannot contain any HTML tags. A web page which needs to be styled using the CSS code defined in this file has to be linked to the file. Advantages: When we use external style sheet, all web pages can be linked to a single CSS file to style the pages. Whenever there are changes in the design of the web pages of a website, only one CSS file needs to be edited for making global changes. 2) Differentiate between the Element selector and the Class selector with the help of an example. Ans : Element selector It selects elements based on their names. The following example selects all
elements on a web page and makes the text red. P { Color:red; } Class Selector The class selector finds elements by their class names. In the following example, all HTML elements with class “cent” will be center-aligned. .cent { text-align : center; }
This is sample paragraph
Heading