CSS Interview Questions & Answers

Showing 10 of 103 questions | Page 4

Technical interview questions and answers are crucial when preparing for a CSS Interview because companies expect candidates to understand selectors, box model, layouts, responsive design, animations, and modern styling techniques. CSS is one of the most important skills for frontend development, and interviews often include both theoretical and practical questions. Companies such as TCS, Wipro, Infosys, Cognizant, and Accenture frequently ask CSS questions to evaluate a candidate’s ability to structure and style web pages professionally. This guide includes the most commonly asked CSS interview questions with easy explanations, helping freshers, students, and job seekers build a strong foundation. Preparing these questions will boost your confidence for frontend developer roles, UI/UX interviews, and campus placements.

Web designers should strengthen their frontend expertise by mastering HTML markup  and JavaScript interactivity  for responsive design 

Showing 10 of 103 questions

31. How frustrating is it to write a specification knowing that you're at the browser vendors' mercy?

That's part of the game. I don't think any specification has a birthright to be fully supported by all browsers. There should be healthy competition between different specifications. I believe simple, author-friendly specifications will prevail in this environment. Microformats are another way of developing new formats. Instead of having to convince browser vendors to support your favorite specification, microformats add semantics to HTML through the CLASS attribute. And style it with CSS.

32. How far can CSS be taken beyond the web page--that is, have generalized or non-web specific features for such things as page formatting or type setting?

Yes, it's possible to take CSS further in several directions. W3C just published a new Working Draft which describes features for printing, e.g., footnotes, cross-references, and even generated indexes. Another great opportunity for CSS is Web Applications. Just like documents, applications need to be styled and CSS is an intrinsic component of AJAX. The "AJAX" name sounds great.

33. How To Style Forms?

Forms and form elements like SELECT, INPUT etc. can be styled with CSS - partially. Checkboxes and Radiobuttons do not yet accept styles, and Netscape 4.xx has certain issues, but here is a tutorial that explains the application of CSS Styles on Form Elements.

34. Can I attach more than one declaration to a selector?

Yes. If more than one declaration is attached to a selector they must appear in a semi colon separated list, e.g.; Selector {declaration1; declaration2} P {background: white; color: black}

35. What is the percentage value in 'font-size' relative to?

It is relative to the parent element's font-size. For example, if the style sheet says: H1 {font-size: 20pt;} SUP {font-size: 80%;} ...then a inside an

will have a font-size of 80% times 20pt, or 16pt.

36. Must I quote property values?

Generally no. However, values containing white spaces, e.g. font-family names should be quoted as whitespaces surrounding the font name are ignored and whitespaces inside the font name are converted to a single space, thus font names made up of more than one word (e.g.) 'Times New Roman' are interpreted as three different names: Times, New and Roman.

37. Do any WYSIWYG editors support the creation of Style Sheets? Any text-based HTML editors?

As support for CSS in browsers has matured in the last year, both WYSIWYG and Text-based HTML editors have appeared that allow the creation or the assistance of creating Cascading Style Sheet syntax. There are now at least two dozen editors supporting CSS syntax in some form. The W3C maintains an up-to-date list of these WYSIWYG and text-based editors.

38. Do URL's have quotes or not?

Double or single quotes in URLs are optional. The tree following examples are equally valid: BODY {background: url(pics/wave.png) blue} BODY {background: url("pics/wave.png") blue} BODY {background: url('pics/wave.png') blue}

39. Document Style Semantics and Specification Language (DSSSL)?

Document Style Semantics and Specification Language is an international standard, an expression language, a styling language for associating processing (formatting and transformation) with SGML documents, for example XML.

40. What is Extensible Stylesheet Language (XSL)?

XSL is a proposed styling language for formatting XML (eXtensible Markup Language) documents. The proposal was submitted to the W3C by Microsoft, Inso, and ArborText.
Questions and Answers for Competitive Exams Various Entrance Test