CSS Interview Questions and Answers

CSS Interview Questions and Answers

Last updated on 14th Oct 2020, Blog, Interview Question

About author

Nandhakumar (Sr Technical Manager )

He is a Expertise in Following Technical Domain with 9+ Years of Experience Also, His Informative Technical Writing Blogs Helps Freshers & JOB Seeker to Enhance their Career

(5.0) | 11142 Ratings 1979

CSS is used to control the style of a web document in a simple and easy way.

CSS is the acronym for “Cascading Style Sheet”. This tutorial covers both the versions CSS1,CSS2 and CSS3, and gives a complete understanding of CSS, starting from its basics to advanced concepts.

1. What is CSS?

Ans:

Cascading Style Sheets, fondly referred to as CSS, is a simple design language intended to simplify the process of making web pages presentable.

2. What are the advantages of using CSS?

Ans:

Following are the advantages of using CSS −

  • CSS saves time − You can write CSS once and then reuse the same sheet in multiple HTML pages. You can define a style for each HTML element and apply it to as many Web pages as you want.
  • Pages load faster − If you are using CSS, you do not need to write HTML tag attributes every time. Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So less code means faster download times.
  • Easy maintenance − To make a global change, simply change the style, and all elements in all the web pages will be updated automatically.
  • Superior styles to HTML − CSS has a much wider array of attributes than HTML, so you can give a far better look to your HTML page in comparison to HTML attributes.
  • Multiple Device Compatibility − Style sheets allow content to be optimized for more than one type of device. By using the same HTML document, different versions of a website can be presented for handheld devices such as PDAs and cell phones or for printing.
  • Global web standards − Now HTML attributes are being deprecated and it is being recommended to use CSS. So it’s a good idea to start using CSS in all the HTML pages to make them compatible with future browsers.
  • Offline Browsing − CSS can store web applications locally with the help of an offline cache.Using of this, we can view offline websites.The cache also ensures faster loading and better overall performance of the website.
  • Platform Independence − The Script offers consistent platform independence and can support latest browsers as well.

3. What are the components of a CSS Style?

Ans:

A style rule is made of three parts −

  • Selector − A selector is an HTML tag at which a style will be applied. This could be any tag like <h1> or <table> etc.
  • Property − A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are converted into CSS properties. They could be color, border etc.
  • Value − Values are assigned to properties. For example, color property can have value either red or #F1F1F1 etc.

4. What is a type selector?

Type selector quite simply matches the name of an element type. To give a color to all level 1 headings −

  • h1 {
  •    color: #36CFFF; 
  • }

5. What is a universal selector?

Ans:

Rather than selecting elements of a specific type, the universal selector quite simply matches the name of any element type −

  • * { 
  •    color: #000000; 
  • }

This rule renders the content of every element in our document in black.

6. What is a Descendant Selector?

Ans:

Suppose you want to apply a style rule to a particular element only when it lies inside a particular element. As given in the following example, style rules will apply to <em> elements only when it lies inside the <ul> tag.

  • ul em {
  •    color: #000000; 
  • }

7. What is a class selector?

Ans:

You can define style rules based on the class attribute of the elements. All the elements having that class will be formatted according to the defined rule.

  • .black {
  •    color: #000000; 
  • }

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

8. Can you make a class selector particular to an element type?

Ans:

You can make it a bit more particular. For example −

  • h1.black {
  •    color: #000000; 
  • }

This rule renders the content in black for only <h1> elements with class attribute set to black.

9. How can we calculate specificity?

Ans:

To calculate specificity we will start with 0, then we have to add 1000 for each ID and we have to add 10 to the attributes, classes or pseudo-classes with each element name or pseudo-element and later we have to add 1 to them.

Example:

  • h2
  •              #content h2
  •            <div id=”content”>
  •               <h2 style=”color:#FF0000”>heading</h2>
  •             </div>

10. How do we make a rounded corner by using CSS?

Ans:

We can make a rounded corner by using the property “border-radius”. We can apply this property to any element.

Example:

  • <html>
  • <head>
  • <style>
  • #rcorners1 {
  •     border-radius: 25px;
  •     background: #715751;
  •     padding: 20px;
  •     width: 200px;
  •     height: 150px;   
  • }
  • </style>
  • </head>
  • <body>
  • <h1>The border-radius Property</h1>
  • <p>Rounded corners for an element with a specified background color:</p>
  • <p id=”rcorners1″>Rounded corners!</p>
  • </body>
  • </html>
New-Example

11. How will you add border images to an HTML element?

Ans:

We can set the image to be used as the border-image alongside an element by using the property of CSS “border-image”.

Example:

  • #borderimg {
  •     border: 15px solid transparent;
  •     padding: 20px;
  •     border-image: url(border.png) 30 round;
  • }

12. What are gradients in CSS?

Ans:

It is a property of CSS which allows you to display a smooth transformation between two or more than two specified colors.

There are two types of gradients that are present in CSS. 

They are:

  • Linear Gradient
  • Radial Gradient
Subscribe For Free Demo

Error: Contact form not found.

13. What is CSS flexbox?

Ans:

It allows you to design a flexible responsive layout structure without using any float or positioning property of CSS. To use CSS flexbox you need to define a flex container initially.

Example:

  • <!DOCTYPE html>
  • <html>
  • <head>
  • <style>
  • .flex-container {
  •   display: flex;
  •   background-color: #f4b042;
  • }
  • .flex-container > div {
  •   background-color: #d60a33;
  •   margin: 10px;
  •   padding: 20px;
  •   font-size: 30px;
  • }
  • </style>
  • </head>
  • <body>
  • <div class=”flex-container”>
  •   <div>1</div>
  •   <div>2</div>
  •   <div>3</div> 
  • </div>
  • <p> Example of  <em>flex</em>box.</p>
  • </body>
  • </html>
Flexbox

14. Write all the properties of the flexbox.

Ans:

There are several properties of the flexbox that are used in the HTML webpage.

They are:

  • flex-direction
  • flex-wrap
  • flex-flow
  • justify-content
  • align-items
  • align-content

15. How to align an image vertically in a division that spans vertically on the whole webpage?

Align-Image-Vertically

Ans:

It can be done by using the syntax vertical-align: middle in the <div1> element and even we can bind the two text spans around with another span and after this, we have to use vertical-align: middle in the content #icon.

16. What is the difference between padding and margin?

Ans:

In CSS, the margin is the property by which we can create space around elements. We can even create space to the exterior defined borders.

In CSS, we have margin property as follows:

  • margin-top
  • margin-right
  • margin-bottom
  • Margin-left

Margin property has some defined values as shown below.

  • Auto – Using this property browser calculates the margin.
  • Length – It sets the margin values in px,pt,cm etc.
  • % – It sets the width % of the element.
  • Inherit – By this property we can inherit the margin property from the parent element.

In CSS, padding is the property by which we can generate space around an element’s content as well as inside any known border.

CSS padding also has properties like,

  1. 1. Padding-top
  2. 2. Padding-right
  3. 3. Padding-bottom
  4. 4. Padding-left

Negative values are not allowed in padding.

  • div {
  • padding-top: 60px;
  • padding-right: 40px;
  • padding-bottom: 50px;
  • padding-left: 70px;
  • }

17. What is the use of the Box Model in CSS?

Ans:

In CSS, the box model is a box that binds all the HTML elements and it includes features like margins, border, padding, and the actual content.

By using a box model we will get the authority to add the borders all around the elements and we can also define the space between the elements.

18. How can we add icons to the web page?

Ans:

We can add icons to the HTML webpage by using an icon library like font-awesome.

We have to add the name of the given icon class to any inline HTML element. (<i> or <span>) . Icons in the icon libraries are scalable vectors that can be customized with CSS.

19. What is a CSS pseudo-class?

Ans:

It is a class that is used to define a special state of an HTML element.

This class can be used by styling an element when a user snooped over it and also it can style an HTML element when it gets the focus.

  • selector:pseudo-class {
  • property:value;
  • }

20. Explain the concept of pseudo-elements in CSS.

Ans:

It is a feature of CSS which is used to style the given parts of an element.

For Example, we can style the first letter or line of an HTML element.

  • selector::pseudo-element {
  • property:value;
  • }

21. What is CSS opacity?

Ans:

It is the property that elaborates on the transparency of an element.

By this property, we can transparent the image that can take the values from 0.0-1.0. If the value is lower, then the image is more transparent. IE8 and earlier versions of the browser can take the values from 0-100.

  • img {
  • opacity: 0.6;
  • filter: alpha(opacity=60); /* For IE8 and earlier */}

22. What is an id selector?

Ans:

You can define style rules based on the id attribute of the elements. All the elements having that id will be formatted according to the defined rule.

  • #black {
  •    color: #000000; 
  • }

This rule renders the content in black for every element with id attribute set to black in our document.

23. Can you make an id selector particular to an element type?

Ans:

you can make it a bit more particular. For example −

  • h1#black {
  •    color: #000000; 
  • }

This rule renders the content in black for only <h1> elements with id attribute set to black.

24. What is a child selector?

Ans:

Consider the following example −

  • body > p {
  •    color: #000000; 
  • }

This rule will render all the paragraphs in black if they are direct child of <body> element. Other paragraphs put inside other elements like <div> or <td> would not have any effect of this rule.

25. What is an attribute selector?

Ans:

You can also apply styles to HTML elements with particular attributes. The style rule below will match all the input elements having a type attribute with a value of text −

  • input[type = “text”] {
  •    color: #000000; 
  • }

The advantage to this method is that the <input type = “submit” /> element is unaffected, and the color applied only to the desired text fields.

26. How to select all paragraph elements with a lang attribute?

Ans:

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

27. How to select all paragraph elements whose lang attribute has a value of exactly “fr”?

Ans:

p[lang=”fr”] – Selects all paragraph elements whose lang attribute has a value of exactly “fr”.

28. How to select all paragraph elements whose lang attribute contains the word “fr”?

Ans:

p[lang~=”fr”] – Selects all paragraph elements whose lang attribute contains the word “fr”.

29. What are the various ways of using CSS in an HTML page?

Ans:

There are four ways to associate styles with your HTML document. Most commonly used methods are inline CSS and External CSS.

  • Embedded CSS − The <style> Element: You can put your CSS rules into an HTML document using the <style> element.
  • Inline CSS − The style Attribute: You can use style attribute of any HTML element to define style rules.
  • External CSS − The <link> Element: The <link> element can be used to include an external stylesheet file in your HTML document.
  • Imported CSS − @import Rule: @import is used to import an external stylesheet in a manner similar to the <link> element.

30. How CSS style overriding works?

Ans:

Following is the rule to override any Style Sheet Rule −

  • Any inline style sheet takes highest priority. So, it will override any rule defined in <style>…</style> tags or rules defined in any external style sheet file.
  • Any rule defined in <style>…</style> tags will override rules defined in any external style sheet file.
  • Any rule defined in an external style sheet file takes lowest priority, and rules defined in this file will be applied only when the above two rules are not applicable.

31. Write all the position states used in CSS.

Ans:

In CSS, there are four position states as stated below:

  • Static(default)
  • Relative
  • Fixed
  • Absolute

32. What are navigation bars in CSS?

Ans:

By using navigation bars we can make an ordinary HTML page into a user-specific and more dynamic web page. Basically, it is a list of links, hence use of <ul> and <li> elements makes the perfect sense.

  • ul {
  • list-style-type: none;
  • margin: 0;
  • padding: 0;
  • }

33. What are the differences between relative and absolute in CSS?

Ans: The main difference between relative and absolute is that “relative” is used for the same tag in CSS and it means that if we write the left:10px then the padding will shift to 10px in the left while absolute is totally relative to the non-static parent.

It means, if we write left:10px then the result will be 10px far from the left edge of the parent element.

34. Define ‘important’ declarations used in CSS.

Ans:

Important declarations are defined as that declaration which is having more importance than the normal declaration.

While executing, these declarations override the declaration which is having less importance.

For example, if there are two users having an important declaration then one of the declarations will override the declaration of another user.

For Example:

  • Body {background: #FF00FF !important; color: blue}

In this body, the background has more weight than the color.

35. Define different cascading methods that can be used inside the cascading order.

Ans:

Cascading order is itself a sorting method that allows many other different sorting methods:

a) Sort by origin: There are some rules which can provide an alternate way defined as:

  • The normal weight of the style sheet of a particular provider will be overridden by the increased weight of the user’s style sheet.
  • Stylesheet rules of a particular user will be overridden by the normal width of the provider’s style sheet.

b) Sort by selector’s specificity: Less specific selector is overridden by the more specific selector.

For example, A contextual selector is less specific in comparison to the ID selector which is a more specific one and with that contextual selector is being overridden by the ID selector.

c) Sort by order specified: This comes in the scenario when the two selectors are of same weight and the other properties than the specification which will be seen for overriding.

Example:

All other styles will be seen overridden if the style attribute is used for inline style.

And also, if the link element is used for external style, then it will override the imported style.

Course Curriculum

Advance your Career with CSS Training By World Class Faculty

  • Instructor-led Sessions
  • Real-life Case Studies
  • Assignments
Explore Curriculum

36. Differentiate between inline and block elements.

Ans:

Inline element does not have an element to set width and height and also it does not have the line break.

Example: em, strong, etc.

Block element specification:

  • They do have the line break.
  • They define the width by setting a container and also allow setting height.
  • It can also contain an element that occurs in the inline element.

Example:

width and height

max-width and max-height

min-width and min-height

hi (i=1-6)- heading element

p- Paragraph element.

37. How is the concept of inheritance applied in CSS?

Ans:

Inheritance is a concept in which the child class will inherit the properties of its parent class. It is a concept which has been used in many languages and is the easy way of defining the same property again.

It is used in CSS to define the hierarchy from the top level to the bottom level. Inherited properties can be overridden by the children’s class if the child uses the same name.

Example:

  • Body {font-size: 15pt;}

And another definition is being defined in the child class

  • Body {font-size: 15pt;}
  • H1 {font-size: 18pt;}

All the paragraph text will be displayed using the property and will be defined in the body except for the H1 style which will show the text in font 18 only.

38. Differentiate between the ID and class.

Ans:

Both ID and class is being used in HTML and assigns the value from CSS.

Please find below the differences:

  • The ID is a kind of element which uniquely assigns a name to a particular element whereas class has an element with a certain set of properties that can be used for the complete block.
  • The id can be used as an element because it can uniquely identify it whereas class is also defined to block the elements and applies too many tags wherever it is used.
  • ID provides the restriction to use its properties to one specific element whereas in class the inheritance is applied to a specific block or group of the element.

39. What is the purpose of % measurement unit?

Ans:

% – Defines a measurement as a percentage relative to another value, typically an enclosing element.

  • p {font-size: 16pt; line-height: 125%;}

40. What is the purpose of the cm measurement unit?

Ans:

cm − Defines a measurement in centimeters.

  • div {margin-bottom: 2cm;}

41. What is the purpose of the em measurement unit?

Ans:

em − A relative measurement for the height of a font in em spaces. Because an em unit is equivalent to the size of a given font, if you assign a font to 12pt, each “em” unit would be 12pt; thus, 2em would be 24pt.

  • p {letter-spacing: 7em;}

42. What is the purpose of the ex measurement unit?

Ans:

ex − This value defines a measurement relative to a font’s x-height. The x-height is determined by the height of the font’s lowercase letter.

  • p {font-size: 24pt; line-height: 3ex;}

43. What is the purpose of the in measurement unit?

Ans:

in − Defines a measurement in inches.

  • p {word-spacing: .15in;}

44. What is the purpose of the mm measurement unit?

Ans:

mm − Defines a measurement in millimeters.

  • p {word-spacing: 15mm;}

45. Name all the modules which are used in the current version of CSS.

Ans:

There are several modules in CSS as stated below:

  • Selectors
  • Box Model
  • Backgrounds and Borders
  • Text Effects
  • 2D/3D Transformations
  • Animations
  • Multiple Column Layout
  • User Interface.

46.  Distinguish between CSS2 and CSS3.

Ans:

The differences between CSS2 and CSS3 are as follows:

  • CSS3 is divided into two various sections which are called a module. Whereas in CSS2 everything accedes into a single document with all the information in it.
  • CSS3 modules are supported almost on every browser and on the other hand modules of CSS and CSS2 are not supported in every browser.
  • In CSS3, we will find that many graphics related characteristics have been introduced like Border-radius or box-shadow, flexbox.
  • In CSS3, a user can precise multiple background images on a webpage by using properties like background-image, background-position, and background-repeat styles.

47. Why is the external style sheet useful?

Ans:

External style sheets are very useful as we write all the styling codes in a single file and it can be used anywhere by just referring to the link of that external style sheet file.

So, if we do any changes in that external file, then the changes can also be observed on the webpage. Thus we can say that it is very useful and it makes your work easy while working on larger files.

48. What are the uses of an embedded style sheet?

Ans:

Embedded style sheet gives us the privilege to define styles in one place in an HTML document.

We can generate multiple classes using an embedded style sheet to use on multiple tag types of a web page and also there is no extra downloading required for importing the information.

Example:

  • <!DOCTYPE html>
  • <html>
  • <head>
  • <style type=”text/css”>
  • p {
  •   font-family: georgia, serif;
  •   font-size: x-large;
  •   color:#ff9900;
  •   }
  • a:hover {
  •   color: LimeGreen;
  •   text-decoration: none;
  •   }
  • </style>
  • </head>
  • <body>

<p>Embedded style sheet gives us the privilege to define styles at one place in a HTML document. 

We can generate multiple classes using embedded style sheet to use on multiple tag types a web page 

and also there is no extra downloading required importing the information.

  • </p>
  • </body> 
  • </html>
Embedded

49. Explain the concept of Tweening.

Ans:

Tweening is the process in which we create intermediate frames between two images to get the appearance of the first image which develops into the second image.

It is mainly used for creating animation.

50. Define CSS image scripts.

Ans:

CSS image scripts are a group of images that are placed into one image. It reduces the load time and request number to the server while projecting multiple images into a single web page.

51. Explain the term Responsive web design.

Ans:

It is a method in which we design and develop a web page according to the user activities and conditions which are based on various components like the size of the screen, portability of the web page on the different devices, etc. It is done by using different flexible layouts and grids.

52. What are CSS counters?

Ans:

CSS counters are variables that can be incremented by rules of CSS that inspector track how many times the variable has been used.

53. What is CSS specificity?

Ans:

CSS specificity is a score or rank that decides which style declaration has to be used to an element. (*) this universal selector has low specificity while ID selectors have high specificity.

There are four categories in CSS which authorize the specificity level of the selector.

  • Inline style
  • IDs
  • Classes, Attributes, and pseudo-classes.
  • Elements and pseudo-elements.

54. What is the purpose of a pc measurement unit?

Ans:

pc − Defines a measurement in picas. A pica is equivalent to 12 points; thus, there are 6 picas per inch.

  • p {font-size: 20pc;}

55. What is the purpose of the pt measurement unit?

Ans:

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

  • body {font-size: 18pt;}
Course Curriculum

Learn On-Demand CSS Training Course from Real Time Experts

Weekday / Weekend BatchesSee Batch Details

56. What is the purpose of the px measurement unit?

Ans:

px − Defines a measurement in screen pixels.

  • p {padding: 25px;}

57. What is the purpose of the vh measurement unit?

Ans:

vh − 1% of viewport height.

  • h2 { font-size: 3.0vh; }

58. What is the purpose of the vw measurement unit?

Ans:

vw − 1% of viewport width.

  • h1 { font-size: 5.9vw; }

59. What is the purpose of the vmin measurement unit?

Ans:

vmin 1vw or 1vh, whichever is smaller.

  • p { font-size: 2vmin;}

60. In how many formats can you specify a CSS color?

Ans:

You can specify your color values in various formats. Following table lists all the possible formats −

FormatSyntaxExample
Hex Code#RRGGBBp{color:#FF0000;}
Short Hex Code#RGBp{color:#6A7;}
RGB %rgb(rrr%,ggg%,bbb%)p{color:rgb(50%,50%,50%);}
RGB Absolutergb(rrr,ggg,bbb)p{color:rgb(0,0,255);}
keywordaqua, black, etc.p{color:teal;}

61. What are browser safe colors?

Ans:

There is the list of 216 colors which are supposed to be most safe and computer independent colors. These colors vary from hex code 000000 to FFFFFF. These colors are safe to use because they ensure that all computers would display the colors correctly when running a 256 color palette.

62. Which property is used to set the background color of an element?

Ans:

The background-color property is used to set the background color of an element.

63. Which property is used to set the background image of an element?

Ans:

The background-image property is used to set the background image of an element.

64. Which property is used to control the repetition of an image in the background?

Ans:

The background-repeat property is used to control the repetition of an image in the background.

65. Which property is used to control the position of an image in the background?

Ans:

The background-position property is used to control the position of an image in the background.

66. Which property is used to control the scrolling of an image in the background?

Ans:

The background-attachment property is used to control the scrolling of an image in the background.

67. Which property is used as a shorthand to specify a number of other background properties?

Ans:

The background property is used as a shorthand to specify a number of other background properties.

68. Which property is used to change the face of a font?

Ans:

The font-family property is used to change the face of a font.

69. Which property is used to make a font italic or oblique?

Ans:

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

70. Which property is used to create a small-caps effect?

Ans:

The font-variant property is used to create a small-caps effect.

71. Which property is used to increase or decrease how bold or light a font appears?

Ans:

The font-weight property is used to increase or decrease how bold or light a font appears.

72. Which property is used to increase or decrease the size of a font?

Ans:

The font-size property is used to increase or decrease the size of a font.

73. Which property is used as shorthand to specify a number of other font properties?

Ans:

The font property is used as shorthand to specify a number of other font properties.

74. Which property is used to set the color of a text?

Ans:

The color property is used to set the color of a text.

75. Which property is used to set the text direction?

Ans:

The direction property is used to set the text direction.

css Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download

76. Which property is used to add or subtract space between the letters that make up a word?

Ans:

The letter-spacing property is used to add or subtract space between the letters that make up a word.

77. Which property is used to add or subtract space between the words of a sentence?

Ans:

The word-spacing property is used to add or subtract space between the words of a sentence.

78. Which property is used to indent the text of a paragraph?

Ans:

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

79. Which property is used to align the text of a document?

Ans:

The text-align property is used to align the text of a document.

80. Which property is used to underline, overline, and strikethrough text?

Ans:

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

81. Which property is used to capitalize text or convert text to uppercase or lowercase letters?

Ans:

The text-transform property is used to capitalize text or convert text to uppercase or lowercase letters.

82. Which property is used to control the flow and formatting of text?

Ans:

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

83. Which property is used to set the text shadow around a text?

Ans:

The text-shadow property is used to set the text shadow around a text.

84. Which property is used to set the width of an image border?

Ans:

The border property is used to set the width of an image border.

85. Which property is used to set the height of an image?

Ans:

The height property is used to set the height of an image.

86. Which property is used to set the width of an image?

Ans:

The width property is used to set the width of an image.

87. Which property is used to set the opacity of an image?

Ans:

The -moz-opacity property is used to set the opacity of an image.

88. Which property of a hyperlink signifies unvisited hyperlinks?

Ans:

The :link signifies unvisited hyperlinks.

89. Which property of a hyperlink signifies visited hyperlinks?

Ans:

The :visited signifies visited hyperlinks.

90. Which property of a hyperlink signifies an element that currently has the user’s mouse pointer hovering over it?

Ans:

The :hover signifies an element that currently has the user’s mouse pointer hovering over it.

91. Which property of a hyperlink signifies an element on which the user is currently clicking?

Ans:

The :active signifies an element on which the user is currently clicking.

92. Which property of a table specifies whether the browser should control the appearance of the adjacent borders?

Ans:

The border-collapse specifies whether the browser should control the appearance of the adjacent borders that touch each other or whether each cell should maintain its style.

92. Which property of a table specifies the width that should appear between table cells?

Ans:

The border-spacing specifies the width that should appear between table cells.

93. Which property of a table controls the placement of the table caption?

Ans:

The caption-side captions are presented in the <caption> element. By default, these are rendered above the table in the document. You use the caption-side property to control the placement of the table caption.

94. Which property of a table specifies whether the border should be shown if a cell is empty?

Ans:

The empty-cells specifies whether the border should be shown if a cell is empty.

95. Which property of a table allows browsers to speed up layout of a table by using the first width properties?

Ans:

The table-layout allows browsers to speed up layout of a table by using the first width properties it comes across for the rest of a column rather than having to load the whole table before rendering it.

96. Which property specifies a shorthand property for setting the margin properties in one declaration?

Ans:

The margin specifies a shorthand property for setting the margin properties in one declaration.

97. Which property specifies the bottom margin of an element?

Ans:

The margin-bottom specifies the bottom margin of an element.

98. Which property specifies the top margin of an element?

Ans:

The margin-top specifies the top margin of an element.

99. Which property specifies the left margin of an element?

Ans:

The margin-left specifies the left margin of an element.

100. Which property specifies the right margin of an element?

Ans:

The margin-right specifies the right margin of an element.

102. How to select all paragraph elements whose lang attribute contains values that are exactly “en”, or begin with “en-“?

Ans:

p[lang|=”en”] – Selects all paragraph elements whose lang attribute contains values that are exactly “en”, or begin with “en-“.

Are you looking training with Right Jobs?

Contact Us

Popular Courses