Interview Questions.

Top 100+ Css Interview Questions And Answers

fluid

Top 100+ Css Interview Questions And Answers

Question 1. What Is Css?

Answer :

Cascading Style Sheets, fondly referred to as CSS, is a easy design language supposed to simplify the method of making web pages presentable.

Question 2. What Are Advantages Of Using Css?

Answer :

Following are the blessings of the use of CSS −
•CSS saves time − You can write CSS once after which reuse identical sheet in a couple of HTML pages. You can outline a style for every HTML element and use it on as many Web pages as you need.
•Pages load faster − If you are using CSS, you do not need to write HTML tag attributes whenever. Just write one CSS rule of a tag and use it on all of the occurrences of that tag. So less code manner quicker download instances.
•Easy preservation − To make a global alternate, certainly alternate the fashion, and all elements in all of the web pages may be updated automatically.
•Superior styles to HTML − CSS has a far wider array of attributes than HTML, so you can deliver a much better appearance in your HTML page in contrast to HTML attributes.
•Multiple Device Compatibility − Style sheets permit content to be optimized for a couple of type of tool. By using the identical HTML document, distinctive versions of a internet site can be supplied for hand-held devices such as PDAs and cellular telephones or for printing.
•Global internet requirements − Now HTML attributes are being deprecated and it's miles being recommended to use CSS. So its a terrific concept to start the usage of CSS in all the HTML pages to make them like minded to future browsers.
•Offline Browsing − CSS can keep net applications locally with the help of an offline catche.Using of this, we will view offline websites.The cache additionally guarantees faster loading and better common overall performance of the website.
•Platform Independence − The Script provide constant platform independence and might aid contemporary browsers as properly.

XML Interview Questions
Question 3. What Are The Components Of A Css Style?

Answer :

A fashion rule is manufactured from 3 elements −

Selector − A selector is an HTML tag at which a fashion can be applied. This will be any tag like <h1> or <table> and so on.

Property − A assets is a kind of attribute of HTML tag. Put actually, all of the HTML attributes are converted into CSS residences. They could be colour, border etc.

Value − Values are assigned to properties. For example, shade belongings can have price either pink or #F1F1F1 and so on.

Question 4. What Is Type Selector?

Answer :

Type selector pretty truly matches the name of an detail type. To deliver a coloration to all degree 1 headings −

h1 
   coloration: #36CFFF;


XML Tutorial
Question 5. What Is Universal Selector?

Answer :

Rather than deciding on factors of a particular kind, the well-known selector quite in reality suits the name of any element kind 

   coloration: #000000;


This rule renders the content material of every detail in our file in black.

CSS3 Interview Questions
Question 6. What Is Descendant Selector?

Answer :

Suppose you need to apply a style rule to a particular element simplest while it lies internal a specific detail. As given within the following instance, style rule will practice to <em> element simplest when it lies inside <ul> tag.
Ul em 
   shade: #000000;


Question 7. What Is Class Selector?

Answer :

You can outline fashion regulations primarily based on the class attribute of the factors. All the factors having that class will be formatted in keeping with the defined rule.
.Black 
   colour: #000000;


This rule renders the content in black for every element with class characteristic set to black in our record.

CSS3 Tutorial HTML Interview Questions
Question eight. Can You Make A Class Selector Particular To An Element Type?

Answer :

You could make it a bit greater precise. For example 

h1.Black

   shade: #000000;


This rule renders the content material in black for most effective factors with magnificence attribute set to black.

Question nine. What Is Id Selector?

Answer :

You can define style policies based totally on the identity characteristic of the elements. All the elements having that identification can be formatted in line with the described rule.
#black 
   coloration: #000000;


This rule renders the content material in black for every detail with id characteristic set to black in our file.

Dreamweaver Interview Questions
Question 10. Can You Make A Id Selector Particular To An Element Type?

Answer :

could make it a piece more unique.

For example:

h1#black

   shade: #000000;


This rule renders the content material in black for only elements with identity attribute set to black.

HTML Tutorial
Question 11. What Is A Child Selector?

Answer :

Consider the subsequent instance:

frame > p

   color: #000000;


This rule will render all the paragraphs in black if they are direct child ofelement. Other paragraphs put interior different elements like or could now not have any impact of this rule.

UI Developer Interview Questions
Question 12. What Is An Attribute Selector?

Answer :

You also can observe styles to HTML factors with precise attributes. The style rule under will in shape all the enter elements having a kind attribute with a cost of textual content

input[type = "text"]

   color: #000000;


The gain to this technique is that the  element is unaffected, and the coloration implemented most effective to the preferred text fields.

XML Interview Questions
Question 13. How To Select All Paragraph Elements With A Lang Attribute?

Answer :

p[lang] : Selects all paragraph elements with a lang characteristic.

CSS Tutorial
Question 14. How To Select All Paragraph Elements Whose Lang Attribute Has A Value Of Exactly "fr"?

Answer :

p[lang="fr"] - Selects all paragraph factors whose lang attribute has a cost of exactly "fr".

Question 15. How To Select All Paragraph Elements Whose Lang Attribute Contains The Word "fr"?

Answer :

p[lang~="fr"] - Selects all paragraph elements whose lang attribute contains the phrase "fr".

CSS Advanced Interview Questions
Question sixteen="en"] - Selects all paragraph factors whose lang attribute carries values which might be precisely "en", or begin with "en-".

CSS Advanced Tutorial
Question 17. What Are The Various Ways Of Using Css In An Html Page?

Answer :

There are four methods to companion patterns together with your HTML document. Most normally used methods are inline CSS and External CSS.

Embedded CSS − The

WordPress Interview Questions
Question 18. How Css Style Overriding Works?

Answer :

Following is the guideline to override any Style Sheet Rule

Any inline fashion sheet takes highest priority. So, it'll override any rule described in <style>...</style> tags or rules described in any external style sheet report.

Any rule described in <style>...</style> tags will override regulations described in any external fashion sheet report.

Any rule described in outside fashion sheet record takes lowest precedence, and policies defined in this file will be applied most effective when above  rules are not relevant.

CSS3 Interview Questions
Question 19. What Is The Purpose Of % Measurement Unit?

Answer :

% - Defines a size as a percent relative to some other fee, normally an enclosing element.

P font-size: 16pt; line-top: one hundred twenty five%;

WordPress Tutorial
Question 20. What Is The Purpose Of Cm Measurement Unit?

Answer :

cm − Defines a measurement in centimeters.

Div margin-bottom: 2cm;

Pure.CSS Interview Questions
Question 21. What Is The Purpose Of Em Measurement Unit?

Answer :

em − A relative size for the peak of a font in em areas. Because an em unit is equal to the dimensions of a given font, if you assign a font to 12pt, each "em" unit might be 12pt; therefore, 2em might be 24pt.

P letter-spacing: 7em;

Question 22. What Is The Purpose Of Ex Measurement Unit?

Answer :

ex − This fee defines a measurement relative to a font's x-height. The x-top is decided by the height of the font's lowercase letter.

P font-length: 24pt; line-height: 3ex;

Pure.CSS Tutorial
Question 23. What Is The Purpose Of In Measurement Unit?

Answer :

in − Defines a size in inches.

P word-spacing: .15in;

XHTML Interview Questions
Question 24. What Is The Purpose Of Mm Measurement Unit?

Answer :

mm − Defines a measurement in millimeters.

P word-spacing: 15mm;

HTML Interview Questions
Question 25. What Is The Purpose Of Pc Measurement Unit?

Answer :

laptop − Defines a measurement in picas. A percent is equal to twelve factors; as a consequence, there are 6 picas according to inch.

P font-length: 20pc;

XHTML Tutorial
Question 26. What Is The Purpose Of Pt Measurement Unit?

Answer :

pt − Defines a size in points. A factor is defined as 1/72nd of an inch.

Frame font-length: 18pt;

Question 27. What Is The Purpose Of Px Measurement Unit?

Answer :

px − Defines a measurement in display screen pixels.

P padding: 25px;

Dreamweaver Interview Questions
Question 28. What Is The Purpose Of Vh Measurement Unit?

Answer :

vh − 1% of viewport height.

H2  font-size: 3.0vh; 

Question 29. What Is The Purpose Of Vw Measurement Unit?

Answer :

vw − 1% of viewport width.

H1  font-length: five.9vw;  

Question 30. What Is The Purpose Of Vmin Measurement Unit?

Answer :

vmin 1vw or 1vh, whichever is smaller.

P  font-length: 2vmin;

Question 31. What Are Browser Safe Colors?

Answer :

There is the listing of 216 hues that are alleged to be most secure and pc independent colours. These shades vary from hexa code 000000 to FFFFFF. These hues are safe to apply due to the fact they ensure that each one computer systems would display the colours effectively while jogging a 256 shade palette.

Question 32. Which Property Is Used To Set The Background Color Of An Element?

Answer :

The history-shade belongings is used to set the history colour of an detail.

Question 33. Which Property Is Used To Set The Background Image Of An Element?

Answer :

The background-photo property is used to set the heritage photo of an detail.

UI Developer Interview Questions
Question 34. Which Property Is Used To Control The Repetition Of An Image In The Background?

Answer :

The historical past-repeat property is used to manipulate the repetition of an photo inside the historical past.

Question 35. Which Property Is Used To Control The Position Of An Image In The Background?

Answer :

The heritage-position property is used to govern the position of an image within the heritage.

Question 36. Which Property Is Used To Control The Scrolling Of An Image In The Background?

Answer :

The historical past-attachment property is used to govern the scrolling of an image in the historical past.

CSS Advanced Interview Questions
Question 37. Which Property Is Used As A Shorthand To Specify A Number Of Other Background Properties?

Answer :

The historical past property is used as a shorthand to specify a number of other heritage properties.

Question 38. Which Property Is Used To Change The Face Of A Font?

Answer :

The font-own family belongings is used to trade the face of a font.

Question 39. Which Property Is Used To Make A Font Italic Or Oblique?

Answer :

The font-style assets is used to make a font italic or oblique.

Question forty. Which Property Is Used To Create A Small-caps Effect?

Answer :

The font-version belongings is used to create a small-caps impact.

WordPress Interview Questions
Question 41. Which Property Is Used To Increase Or Decrease How Bold Or Light A Font Appears?

Answer :

The font-weight belongings is used to boom or lower how ambitious or light a font appears.

Question 42. Which Property Is Used To Increase Or Decrease The Size Of A Font?

Answer :

The font-length assets is used to boom or lower the scale of a font.

Pure.CSS Interview Questions
Question forty three. Which Property Is Used As Shorthand To Specify A Number Of Other Font Properties?

Answer :

The font belongings is used as shorthand to specify a number of other font homes.

Question 44. Which Property Is Used To Set The Color Of A Text?

Answer :

The colour belongings is used to set the colour of a text.

Question 45. Which Property Is Used To Set The Text Direction?

Answer :

The path assets is used to set the textual content course.

Question 46. Which Property Is Used To Add Or Subtract Space Between The Letters That Make Up A Word?

Answer :

The letter-spacing property is used to add or subtract area among the letters that make up a phrase.

Question forty seven. Which Property Is Used To Add Or Subtract Space Between The Words Of A Sentence?

Answer :

The phrase-spacing belongings is used to add or subtract area between the words of a sentence.

Question forty eight. Which Property Is Used To Indent The Text Of A Paragraph?

Answer :

The textual content-indent property is used to indent the text of a paragraph.

Question forty nine. Which Property Is Used To Align The Text Of A Document?

Answer :

The text-align belongings is used to align the textual content of a record.

Question 50. Which Property Is Used To Underline, Overline, And Strikethrough Text?

Answer :

The text-decoration assets is used to underline, overline, and strikethrough text.

Question 51. Which Property Is Used To Capitalize Text Or Convert Text To Uppercase Or Lowercase Letters?

Answer :

The text-transform assets is used to capitalize text or convert textual content to uppercase or lowercase letters.

Question fifty two. Which Property Is Used To Control The Flow And Formatting Of Text?

Answer :

The white-space property is used to control the drift and formatting of text.

Question fifty three. Which Property Is Used To Set The Text Shadow Around A Text?

Answer :

The textual content-shadow belongings is used to set the textual content shadow round a textual content.

Question fifty four. Which Property Is Used To Set The Width Of An Image Border?

Answer :

The border assets is used to set the width of an photograph border.

Question fifty five. Which Property Is Used To Set The Height Of An Image?

Answer :

The height belongings is used to set the peak of an photo.

Question 56. Which Property Is Used To Set The Width Of An Image?

Answer :

The width belongings is used to set the width of an photograph.

Question 57. Which Property Is Used To Set The Opacity Of An Image?

Answer :

The -moz-opacity assets is used to set the opacity of an photo.

Question fifty eight. Which Property Of A Hyperlink Signifies Unvisited Hyperlinks?

Answer :

The :hyperlink signifies unvisited hyperlinks.

Question fifty nine. Which Property Of A Hyperlink Signifies Visited Hyperlinks?

Answer :

The :visited indicates visited hyperlinks.

Question 60. Which Property Of A Hyperlink Signifies An Element That Currently Has The User's Mouse Pointer Hovering Over It?

Answer :

The :hover signifies an element that currently has the consumer's mouse pointer soaring over it.




CFG