Articles

CSS interview questions for UI Developers

by Vijay Kumar Software Engineer

An interview is a conversation between the interviewer and the interviewee where questions are asked by the interviewer to obtain information from the interviewee. Below are a few CSS Interview Questions

CSS Questions and answers

1. What is CSS?

CSS stands for Cascading Style Sheets. CSS describes how HTML elements are to be displayed on screen, paper, or in other media. CSS saves a lot of work. It can control the layout of multiple web pages all at once.

2. What are CSS components?

Below are the few basic components of css

  • A selector is an HTML tag at which style will be applied. The tags are like

    etc.

  • Property is a type of HTML tag attributes, which are converted into CSS properties. The examples of this are a border, color etc.
  • Values that are assigned to properties like defining any value of color or any other defined property in CSS.


3. What is difference between a relative, fixed, absolute and statically positioned element?

Below are difference between a relative, fixed, absolute and statically positioned element.

  • static - The default position; the element will flow into the page as it normally would. The toprightbottomleft and z-index properties do not apply.
  • relative - The element's position is adjusted relative to itself, without changing layout (and thus leaving a gap for the element where it would have been had it not been positioned).
  • absolute - The element is removed from the flow of the page and positioned at a specified position relative to its closest positioned ancestor if any, or otherwise relative to the initial containing block. Absolutely positioned boxes can have margins, and they do not collapse with any other margins. These elements do not affect the position of other elements.
  • fixed - The element is removed from the flow of the page and positioned at a specified position relative to the viewport and doesn't move when scrolled.
  • sticky - Sticky positioning is a hybrid of relative and fixed positioning. The element is treated as relative positioned until it crosses a specified threshold, at which point it is treated as fixed positioned.


4. What is a CSS rule?

Web browsers apply CSS rules to a document to affect how they are displayed. A CSS rule is formed from:

  • set of properties, which have values set to update how the HTML content is displayed,
  • selector, which selects the element(s) you want to apply the updated property values to.

A set of CSS rules contained within a stylesheet determines how a webpage should look.

5. Give some Advantages of Embedded style sheet in CSS.

Advantages of Embedded style sheet in CSS

  • We can directly access specific HTML page CSS.
  • The changes made on a style tag will remain for the same web page.

6. What is the Descendant selector in CSS?.

In CSS when we use a tag inside another tag and only want to style those nested tag, we use the descendant selector. For example, here we only want to color blue those emphasize tags that are inside the ordered list tags.

Prepare Latest CSS Interview Questions

7. What is Responsive Web Design?

Responsive web design aka RWD is a method of creating a webpage which can make a perfect display on every platform such as tablets, desktop, mobiles, and laptops. So we do not have to create web-pages for different devices and the display of web page automatically change according to the display size of the device.

8. What are the 3 types of CSS?

Inline, Internal, and External CSS are the 3 types of CSS.

Job interviews often include an opportunity for you to ask your future employer questions. The interviewer expects you to ask questions about the company, department, functional area and the job that you are interviewing for. Read More Advanced CSS Interview Questions


Sponsor Ads


About Vijay Kumar Innovator   Software Engineer

9 connections, 0 recommendations, 52 honor points.
Joined APSense since, January 24th, 2018, From New Delhi, India.

Created on Dec 6th 2019 09:17. Viewed 487 times.

Comments

No comment, be the first to comment.
Please sign in before you comment.