Category: CSS Question And Answer
-
What is VH/VW (viewport height/ viewport width) in CSS?
VH and VW are CSS units used to measure viewport height and viewport width respectively in percentage form in the responsive design techniques. E.g. If the height of the browser is 1000px, then VH is 1/100 of the height of the viewport that is 1000px*(1/100) = 10px, which is the height of the browser. The…
-
What is a CSS Preprocessor? What are Sass, Less, and Stylus? Why do people use them?
CSS preprocessor is a tool used to enhance the basic functionality and let us use the complex logical syntax such as variables, functions, mixins, and code nesting within vanilla CSS scripts themselves. People use SASS, LESS, and Stylus in order to extend the basic functionality of vanilla CSS.
-
What are the different types of Selectors in CSS?
Universal Selector, Element type Selector, ID selector, Class selector, Descendant combinatory, Child Combinator, General Sibling Combinator, Adjacent sibling combinator, and Attribute selector.
-
Tell us about the general CSS nomenclature.
In CSS, the styling commands are written in value and property fashion. CSS includes a system terminator- semicolon. The entire style is wrapped in curly braces and attached to the selector. This creates a style sheet that can be applied to an HTML page.
-
Explain responsive web design.
Responsive Design is a web page creation approach that uses flexible images, flexible layouts, and CSS media queries. This design approach aims to build web pages that detect the orientation and screen size of the visitors so that the layout can be changed accordingly.
-
Define contextual selectors.
In CSS, contextual selectors allow developers to specify styles of different parts of the document. Styles can be assigned directly to specific HTML tags or create independent classes and assign tags to them.
-
Name some font-related CSS attributes.
The font-related attributes are Font- style, variant, weight, family, size, etc.
-
Tell us about the property used for image scroll controlling?
The background-attachment property is used to set whether the background image is fixed or it scrolls with the rest of the page. Example for a fixed background-image: body { background-image: url(‘url_of_image’); background-repeat: no-repeat; background-attachment: fixed; }