Q. What is CSS?
Ans. CSS stands for Cascading Style Sheets. It is used to control the appearance and layout of web pages.
Q. What is the full form of CSS?
Ans. Cascading Style Sheets.
Q. Why is CSS used in web designing?
Ans. CSS is used to style HTML elements by controlling colours, fonts, spacing, borders, backgrounds, and page layouts.
Q. What are the three main types of CSS?
Ans. The three main types are inline CSS, internal CSS, and external CSS.
Q. What is inline CSS?
Ans. Inline CSS applies styles directly to an HTML element using its style attribute.
Q. What is internal CSS?
Ans. Internal CSS is written inside a style element, usually within the head section of an HTML document.
Q. What is external CSS?
Ans. External CSS is stored in a separate .css file and linked to an HTML document using a link element.
Q. What is a CSS selector?
Ans. A CSS selector identifies the HTML elements to which a set of CSS rules should apply.
Q. What is a CSS property?
Ans. A CSS property specifies the aspect of an element to style, such as colour, width, font size, or margin.
Q. What is a CSS value?
Ans. A CSS value specifies the setting assigned to a property, such as red for the color property or 20px for font size.
Q. How is a class selector written in CSS?
Ans. A class selector begins with a dot followed by the class name, for example .highlight.
Q. How is an ID selector written in CSS?
Ans. An ID selector begins with a hash symbol followed by the ID name, for example #header.
Q. What is the purpose of the color property?
Ans. The color property sets the foreground colour of text.
Q. What is the difference between margin and padding?
Ans. Margin creates space outside an element border, while padding creates space between the content and the border.
Q. What is the CSS box model?
Ans. The CSS box model describes an element as content surrounded by padding, border, and margin.
Q. What is the purpose of the background-color property?
Ans. The background-color property sets the background colour of an element.
Q. What is a CSS pseudo-class?
Ans. A pseudo-class selects an element based on a state or condition, such as :hover when a pointer is over an element.
Q. What is a responsive web design?
Ans. Responsive web design adapts a website layout to different screen sizes and devices, often using flexible layouts and media queries.
Q. What is a CSS media query?
Ans. A media query applies CSS rules when specified conditions, such as viewport width, are met.
Q. Why is external CSS useful?
Ans. External CSS promotes reuse, consistency, and easier maintenance of styles across multiple web pages.