Here we have mentioned most frequently asked CSS3 Interview Questions and Answers specially for freshers and experienced.


 

1. What Is Wrapping In Css3?

Ans:

Wrapping is a vital property for proper display of contents in web pages. If wrapping is disabled then the user could not display and view long lines that goes outside the window boundary and thus becomes useless.

2. What Is The Syntax Of Opacity In Css3?

Ans:

style=”opacity:0.4;filter:alpha(opacity=40)”
Firefox uses the property opacity:x for transparency, while IE uses filter:alpha (opacity=x).

3. How Do You Manage The Complete Site In Center Of The Browser, Which Is Completely Using Divs Using The Help Of Css2 Or Css3?

Ans:

In CSS file
1. body{width:100%;}
2. Create a div tag and assign a class, say ‘container’ and place all your content in this div tag.
3. Assign properties to this class in CSS file
container{width:777px; margin:auto;}

4. How Is Multi-column Feature Used In Css3?

Ans:

By using the Multi-Column feature of CSS3 the web designers can get their output in multiple columns with definitions defined for each column like column-width, column-count.

5. What Is The Syntax Of Word Wrap In Css3?

Ans:

The general syntax word-wrap property of CSS3 is as follows:
word-wrap: normal| break-word
The default initial value is normal in the above syntax.

6. How Flexibility Is Achieved More In Css3?

Ans:

Flexibility achieved is in greater ratio in CSS3 because of the feature of handling multiple style sheets in CSS3 and because of the modularized approach of CSS3.

7. What Are The Values That Can Be Taken By Property White-space Of Css3?

Ans:

The five values that can be taken by property white-space of CSS3 are normal, pre, no wrap, pre-wrap and pre-line.

8. What Are Cascading Style Sheets?

Ans:

Cascading style sheets help the designer in various ways. It primarily helps to design style sheets for content and HTML pages. It can be applied to any XML document or markup language.

9. Explain About Some Of The Features Of Css?

Ans:

Some of the features used by CSS are to define a layout, colors, fonts, etc. It separates the content from the design part which makes the content much more visible thereby improving productivity of the entire process. It can make the same page appear in different formats.

10. Explain About The Rules Present In Style Sheets?

Ans:

A huge list of rules is defined for style sheets. Each rule consists of selectors and declaration block. A declaration block consists of declarations which can be defined and separated by using a semicolon within curly braces. Also each declaration consists of a colon, a property and a semicolon.



 

11. Explain About The Hover Element?

Ans:

A hover element is activated when the user moves a pointer over the area where HTML coding is defined. This style is being extensively used for online advertising. It is appended to #elementid:hover.

12. State Some Of The Uses Of Css?

Ans:

CSS offers many possibilities to a designer and developer. Some of them are
1) Moving of the entire style sheet coding to a separate external folder.
2) Repetition and code reuse features make CSS rich.
3) Presentation and structure are made different by CSS etc.

13. State The Different Type Of Author Styles?

Ans:

A web page author, developer, designer, etc can describe styles in three different forms they are
1) External style sheets
2) Embedded style
3) Inline styles
4) Local and default style sheet.
A default style sheet consists of the style imparted by the browser which the user is accessing for the information.

14. What Are The Main Goals Of Applying Style Sheets?

Ans:

The main use of style sheet is to give the user a greater degree of control over his presentation. If the user does not like a certain font he can change it with flexibility without any difficulty.
Also a developer can minimize the effects which a browser can have on the application or the text part of the webpage.
Control over the entire web page without any external influences, separation of the page from the HTML code part.

15. Explain About Css1?

Ans:

W3C recommended adoption of CSS1in 1996. Some of the capabilities and features present in CSS1 are as follows.
1) Font properties
2) Background colors, text colors, etc
3) Spacing between text, words, etc
4) Tables, images alignment
5) Border, margin, padding and positioning of elements
6) Attributes are uniquely identified and classified generically.

16. What Are The Additional Features Which Were Present In Css2 Compared To Css1?

Ans:

Many of the new features were present in CSS2 some of them are as follows.
1) Positioning of elements will be according to the relative, fixed and the absolute positioning.
2) Inclusion of large number of media functions.
3) Shadows, bidirectional support for text and aural style sheets.

17. Explain About Css Filter?

Ans:

CSS filter solves designers and coders difficulties. With the help of these filters one can write entirely different code or modify the existing design patterns so that browsers receive CSS specifications which they support, thereby not allowing the browsers to make or create any unnecessary changes.

18. Explain About Internet Explorer Box Model Bug?

Ans:

Designers had a very tough time dealing with this bug, because it will not display box widths appropriately on the webpage. It displayed the block to be narrow in size. This bug can be rectified by using CSS filter and hacks. Also correct usage and documentation of XHTML can solve the problems.

19. Explain About Vertical Control Limitation?

Ans:

Vertical control limitations are always a nightmare for a designer. Horizontal positioning of text or element is always easy but vertically positioning an element always leads to convoluted and impossible tasks. CSS has unsupported rules for vertical placement of elements.

20. Explain About Absence Of Expressions?

Ans:

CSS currently does not have the ability to specify property values as simple expressions. For example if you want to calculate the size of all the columns but you have a restriction on the sum of all columns. This problem has been solved by many browsers by proprietary expressions which did the job well.




 

21. Explain About Lack Of Orthogonality?

Ans:

Lack of orthogonality explains about the various multiple jobs which are either undefined correctly for a specific application or used multiple times for the same job. CSS defines that internal elements of a table will not have margins so usage of border spacing is appropriate which leads to confusion.

22. Explain About The Ease Of Maintenance With Css.

Ans:

An effective style sheet has effective use of inheritance and cascading style sheets. When changes are applied to a single element of this global style sheet every element of the web page changes. This made the maintenance easy because here we can change the style of the whole page by effecting a change to a single element.

23. Explain About Float Containment?

Ans:

CSS does not support float elements as it can cause overflow of the elements. Floats also tend to vary according to the web browser resolution and size but positions do not. There are some multiple properties which can define about float but they have their own limitations.

24. State Some Limitations Of Style Sheets?

Ans:

Style sheets do have its own share of limitations some of them are as follows: –
1) Inconsistent browser support
2) Vertical control limitations
3) Margin collapsing, float containment, control of element shapes, etc
4) Lack of column declaration and variables are some of the limitations present in CSS.

25. What Is Id Selector?

Ans:

ID selector is an individually identified (named) selector to which a specific style is declared. Using the ID atthbute the declared style can then be associated with one and only one HTML element per document as to differentiate it from all other elements ID selectors are created by a character# followed by the selectors name. The name can contain characters a-z. A-Z. digits 0-9. period. hyphen. escaped characters, Unicode characters 161 -255. as well as any Unicode character as a numeric code, however they cannot start with a dash or a digit.
#abc 123 {color red: background: black)
This and only this element can be identified as abcl23

26. What Is Css Rule ‘ruleset’?

Ans:

There are two types of CSS rules: ruleset and at-rule. Ruleset identifies selector or selectors and declares style which is to be attached to that selector or selectors. For example P {text-indent: 10pt) is a CSS rule. CSS rulesets consist of two parts: selector e.g. P and declaration. e.g. {text-indent: 10pt)
P {text-indent: 10pt) – CSS rule (ruleset)
{text-indent: 10pt) – CSS declaration
text-indent – CSS property
10pt-CSS value

27. Display And Visibility Properties Are Used To Hide And Show Elements In Any Page. Then How They Are Different From Each Other?

Ans:

As said both the properties are used to hide and Show elements but they are different in the way they both work visibility property, set to hidden will still occupy the space in the layout but display:none does not take up the space in the page

28. How To Page Break After An Html Element In Css?

Ans:

Use following code snippet

Place your text

After above code. the rest content will appear in the next page. (It will not be visible as next page in browser but on the printer and in Print Preview, you will see them as next page)

29. What Is The Default Value Of “position” Attribute In Css?

Ans:

Default value Is “static “.

30. What Are The Values Of “position” Attribute In Css?

Ans:

Possible values are static. relative, absolute, fixed. Inherit.


 

31. What is the difference between CSS and CSS3?

Ans:

CSS3 is upgraded version of CSS with new future like Selectors, Box Model, Backgrounds and Borders, Text Effects,2D/3D Transformations, Animations, Multiple Column Layout, User Interface etc.

32. List out CSS3 modules?

Ans:

Below is list of most important CSS3 modules are

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

33. What is the CSS3 animation?

Ans:

When the animation is created in the @keyframe, bind it to a selector, otherwise, the animation will have no effect.
Bind the animation to a selector by specifying at least these two CSS3 animation properties:

  • Specify the name of the animation
  • Specify the duration of the animation

34. Explain How flexibility is achieved more in CSS3?

Ans:

Flexibility achieved is in the greater ratio in CSS3 because of the feature of handling multiple style sheets in CSS3 and because of the modularized approach of CSS3.

35. Explain What are the values that can be taken by property white-space of CSS3?

Ans:

The five values that can be taken by property white-space of CSS3 are

  • Normal
  • pre
  • nowrap
  • pre-wrap
  • pre-line

36. What are the possible values of the “Position” attributes?

Ans:

The possible value of the “Position” attributes are

  • absolute
  • fixed
  • inherit
  • relative
  • static

37. What is the word wrap/word wrapping in CSS3?

Ans:

word wrap/word wrapping is used to allow long words to be able to break and wrap onto the next line in css3 we used word-wrap property like below class

.wrapWord{word-wrap:break-word;}

38. What is CSS3 Flexbox?

Ans:

Flexible boxes, or flexbox, is a new layout mode in CSS3. Flexbox consists of flex containers and flex items.
A flex container is declared by setting the display property of an element to either flex (rendered as a block) or inline-flex (rendered as inline).Inside a flex container, there are one or more flex items.

39. What are CSS3 Transitions?

Ans:

CSS3 transitions allow you to change property values smoothly (from one value to another), over a given duration.

div {
-webkit-transition: width 2s, height 4s; /* Safari */
transition: width 2s, height 4s;
}

40. What is the syntax of opacity in CSS3?

Ans:

style="opacity:0.4;filter:alpha(opacity=40)"

Firefox uses the property opacity:x for transparency, while IE uses



 

41. List some advantages to CSS3 animations over script-based animation?

Ans:

Advantages of using CSS3 animations over script-based animation techniques are as follows:
Easy to use and anybody can create them without the knowledge of JavaScript.
Executes well even under reasonable system load. As simple animations perform poorly in JavaScript, the rendering engine uses the frame-skipping techniques to allow smooth flow of animation.
Allows the browser to control the animation sequence, optimize performance and efficiency by reducing the update frequency of animations executing in tabs that aren’t currently visible.
Difference Between CSS2 and CSS3

  • Modules
  • Media Queries
  • Namespaces
  • Selectors
  • Color

1) CSS3 Modules
1) The main difference between CSS2 and CSS3 is that CSS3 divided into two different sections Called Modules.
2) In CSS2 everything is submitted as a single document with all the Cascading Style Sheets information within it.
3) These Modules are much easier for different browsers to accept various aspects of CSS3 and implement.
4) There is a wider range of browser support for CSS3 Modules over CSS and CSS2.

CSS3 Modules List

  • Selectors
  • Box Model
  • Backgrounds
  • Image Values and Replaced Content
  • Text Effects
  • 2D Transformations
  • 3D Transformations
  • Animations
  • Multiple Column Layout
  • User Interface

2) CSS3 Media Queries
1) In CSS2, we have Media Types, users can define different style rules for different media types like computer screens, printers, and handled devices.
2) But in CSS3, instead of using Media Types, extended the CSS2 Media Types idea with Media Queries.
3) Unlike looking for a type of device in CSS2 media type, CSS3 Media Queries look at the capability of the device.
4) CSS3 media queries look for width and height of the viewport, width, and height of the device, orientation, and resolution of the screen.
CSS3 Media Types

  • all – Used for all media type devices
  • print – Used for printers
  • screen – Used for computer screens, tablets, smart-phones etc.
  • speech – Used for screenreaders that “reads” the page out loud

CSS3 Media Query Example

If the viewport is minimum 480 pixels or widee then the body backgroud color will be changed to blue.

@media screen and (min-width: 480px) {
body {
background-color: blue;
}
}

3) CSS3 Namespaces
This CSS Namespaces module defines syntax for using namespaces in CSS. It defines the @namespace rule for declaring a default namespace and for binding namespaces to namespace prefixes.
@namespace “http://www.w3.org/1999/xhtml”;
@namespace svg “http://www.w3.org/2000/svg”;
The first rule declares a default namespace http://www.w3.org/1999/xhtml to be applied to names that have no explicit namespace component.
The second rule declares a namespace prefix svg that is used to apply the namespace http://www.w3.org/2000/svg where the svg namespace prefix is used.
4) CSS3 Selectors
In CSS3, there are few new Selectors and pseudo-elements are introduced, let’s discuss them.
1) attribute beginning matches exactly
element[foo^=”bar”]
The element has an attribute called foo that begins with “bar” e.g.
2) attribute ending matches exactly
element[foo$=”bar”]
The element has an attribute called foo that ends with “bar” e.g.
3) attribute contains the match
element[foo*=”bar”]
The element has an attribute called foo that contains the string “bar” e.g.
CSS3 new pseudo-classes:
:root
The root element of the document. In HTML this is always
:nth-child(n)
use this to match exact child elements or use variables to get alternating matches
:nth-last-child(n)
match exact child elements counting up from the last one
:nth-of-type(n)
match sibling elements with the same name before it in the document tree
:nth-last-of-type(n)
match sibling elements with the same name counting up from the bottom
:last-childmatch
the last child element of the parent
:first-of-typematch
the first sibling element of that type
:last-of-typematch
the last sibling element of that type
:only-childmatch
the element that is the only child of its parent
:only-of-typematch
the element that is the only one of its type
:emptymatch
the element that has no children (including text nodes)
:targetmatch
an element that is the target of the referring URI
:enabledmatch
the element when it’s enabled
:disabledmatch
the element when it’s disabled
:checkedmatch
the element when it’s checked (radio button or checkbox)
:not(s)
match when the element does not match the simple selectors
New CSS3 Style Properties
Many graphics related properties are introduced in CSS3.
1) Border-radius or box-shadow, flexbox or even CSS Grid are newer styles introduced in CSS3.
2) In CSS3 the box model not changed but using new style properties users can change background, border and styles of a box.
3) In CSS3 using properties like background-image, background-position, and background-repeat styles users can specify multiple background images to be placed on top of one another.
4) CSS3 background-clip property defines how the background image should be clipped.
5) CSS3 background-origin property determines whether the background should be placed in the padding box, the border box, or the content box.
6) CSS3 background-size property allows you to indicate the size of the background image. This property allows users to stretch smaller images to fit the page.
7) CSS borders can be the styles of solid, double, dashed, and image. In addition to existing boarder properties CSS3 brings in the ability to create rounded corners.
8) There are some new border-radius properties are introduced in CSS3.
9) border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-top-left-radiusThese properties allow you to create rounded corners on your borders.
10) border-image-source – Specifies the image source file to be used instead of border styles already defined.
11) border-image-slice – Represents the inward offsets from the border image edges
12) border-image-width – Defines the value of the width for your border image
13) border-image-outset – Specifies the amount that the border image area extends beyond the border box
14) border-image-stretch – Defines how the sides and middle parts of the border image should be tiled or scaled
15) border-image – The shorthand property for all the border image properties
16) column-width – Defines the width of your columns should be.
17) column-count – Defines the number of columns on the page.
18) columnsShorthand property where you can define either the width or number.
19) column-gap Defines the width of the gaps between the columns.
20) column-rule-color Defines the color of the rule.
21) column-rule-style Defines the style of the rule (solid, dotted, double, etc.)
22) column-rule-width Defines the width of the rule
23) column-rule A shorthand property defining all three column rule properties at once.
24) CSS Template layout module and CSS3 Grid positioning module- creating grids with CSS
25) CSS3 Text module – outline text and even create drop-shadows with CSS
26) CSS3 Color module – with opacity
27) Changes to the box model – including a marquee property that acts like the IE tag
28) CSS3 User Interface module – giving you new cursors, responses to actions, required fields, and even resizing elements
29) CSS3 Ruby module – provides support for languages that use textual ruby to annotate documents
30) CSS3 Paged Media module – for even more support for paged media (paper, transparencies, etc)
31) Generated content – running headers and footers, footnotes, and other content that is generated programmatically, especially for paged media
32) CSS3 Speech module – changes to aural CSS
33) CSS3 supports additional color properties like RGBA colors, HSL colors, HSLA colors, Opacity.

42. How can you create Rounded corners in CSS3?

Ans:

By using CSS3 border-radius property, we can create rounded corners to body or text.
Sample CSS3 Code to create Rounded corners:
Boarder-Radius Syntax:

#roundcorners {
border-radius: 60px/15px;
background: #FF0001;
padding: 10px;
width: 200px;
height: 150px;
}

43. Given the following HTML:

<div id="page">
<h1>Heading Title</h1>
<h2>Subheading Title</h2>
<h2>Subheading Title</h2>
<h1>Heading Title</h1>
<h2>Subheading Title</h2>
<h1>Heading Title</h1>
</div>

How could you use CSS to achieve the following automatic numbering:

1) Heading Title
1.1) Subheading Title
1.2) Subheading Title
2) Heading Title
2.1) Subheading Title
3) Heading Title

Ans:

The following CSS will achieve this type of automatic numbering:

#page {
counter-reset: heading;
}

h1:before {
content: counter(heading)”) “;
counter-increment: heading;
}

h1 {
counter-reset: subheading;
}

h2:before {
content: counter(heading)”.” counter(subheading)”) “;
counter-increment: subheading;
}

44. What are the associated border-radius properties?

Ans:

There are four border-radius properties are there, they are:
border-radius Use this element for setting four boarder radius property
border-top-left-radius Use this element for setting the boarder of top left corner
border-top-right-radius Use this element for setting the boarder of top right corner
border-bottom-right-radius Use this element for setting the boarder of bottom right corner
border-bottom-left-radius Use this element for setting the boarder of bottom left corner

45. How can you create CSS3 property for each corner?

Ans:

We can create property for each corner by defining style for each corner, see below example:

<style>
#roundcorners1 {
border-radius: 15px 50px 30px 5px;
background: #a44170;
padding: 20px;
width: 100px;
height: 100px;
}
#roundcorners2 {
border-radius: 15px 50px 30px;
background: #a44170;
padding: 20px;
width: 100px;
height: 100px;
}
#roundcorners3 {
border-radius: 15px 50px;
background: #a44170;
padding: 20px;
width: 100px;
height: 100px;
}
</style>

46. Is it possible to create border as a Image in CSS3?

Ans:

Yes it is possible, by using CSS3 border image property we can use image as a border.

47. What are the associate boarder image properties in CSS3?

Ans:

There are four major boarder image properties are there, they are:
border-image-source Used to set the image path
border-image-slice Used to slice the boarder image
border-image-width Used to set the boarder image width
border-image-repeat Used to set the boarder image as rounded, repeated and stretched

48. Can you write CSS3 code for creating boarder image?

Ans:

Here is the CSS3 code for creting boarder as image:

#borderimg {
border: 10px solid transparent;
padding: 15px;
border-image-source: url(/css/images/border-bg.png);
border-image-repeat: round;
border-image-slice: 30;
border-image-width: 10px;
}

49. What is Multi Background property in CSS3?

Ans:

Multi background property is used to add one or more images to the background in CSS3.

50. What are the most commonly used Multi Backgroud properties in CSS3?

Ans:

There are four most commonly used multi background properties, they are:
background-clip Used to declare the painting area of the background
background-image Used to specify the background image
background-origin Used to specify position of the background images
background-size Used to specify size of the background images




 

51. Can you write CSS3 code for creating Multi Background Images?

Ans:

Here is the CSS3 code for creating multi background images.

#borderimg {
border: 10px solid transparent;
padding: 15px;
border-image-source: url(/css/images/border-bg.png);
border-image-repeat: round;
border-image-slice: 30;
border-image-width: 10px;
}

52. What are the new color properties introduced in CSS3?

Ans:

In CSS3, there are few Color properties are introduced they are:
RGBA colors
HSL colors
HSLA colors
Opacity

53. What RGBA stands for in CSS3?

Ans:

RGBA stands for Red Green Blue Alpha.

54. What HSL stands for in CSS3?

Ans:

HSL stands for hue, saturation, lightness.

55. What HSLA stands for in CSS3?

Ans:

HSLA stands for hue, saturation, lightness and alpha.

57. What is gradient in CSS3?

Ans:

Gradients displays the combination of two or more colors in one grid.

58. What are the types of Gradients in CSS3?

Ans:

In CSS3 there are mainly two types of gradients are there, they are:
Linear Gradients(down/up/left/right/diagonally)
Radial Gradients

59. How can you add gradients to your project?

Ans:

All gradients are read from a gradients.json file which is available in this project’s repo. Simply add your gradient details to it and submit a pull request.
http://uigradients.com/#

60. How can you create shadow effets in CSS3?

Ans:

We can create shadow effects for text using text-shadow and for boxes using box-shadow properties.


 

61. Can you write CSS3 code to create shadow effect?

Ans:

Here is the sample code for shadow effects:
Text shadow for text element:

H1 {
text-shadow: 2px 2px;
}
Box shadow for box element:

62. What are the newly introduced Text related features in CSS3?

Ans:

There are mainly three Text related features are introduced, they are:
text-overflow
text-emphasis
text-align-last
word-wrap
word-break

63. What is text-overflow property used in CSS3?

Ans:

The text-overflow property determines how overflowed content that is not displayed is signaled to users.
Example 1:

p.text1 {
white-space: nowrap;
width: 400px;
border: 2px solid #000000;
overflow: hidden;
text-overflow: clip; //It wont show overflow text.
}

Example 2:

p.text2 {
white-space: nowrap;
width: 300px;
border: 2px solid #000000;
overflow: hidden;
text-overflow: ellipsis; //It indicates overflow text with dots …
}

64. What is word-break property used in CSS3?

Ans:

In CSS3 word-break is used to break the line.
Example 1:

<style>
p.text1 {
width: 150px;
border: 2px solid #000000;
word-break: keep-all; //It breaks the word with hyphens at line break
}

Example 2:

p.text2 {
width: 150px;
border: 2px solid #000000;
word-break: break-all; // It breaks the work without hyphens in line break
}
</style>

65. What is CSS3 word-wrap property?

Ans:

In CSS3 word-wrap is used to break the line and wrap onto next line.

66. What are the different web fonts formats in CSS3?

Ans:

Web fonts allows users to use the fonts in CSS3, which are not installed on local system.
There are five types of web fonts formats are there, they are:
1) TTF – TrueType Fonts
2) OTF – OpenType Fonts
3) WOFF – The Web Open Font Format
4) SVG Fonts
5) EOT – Embedded OpenType Fonts

67. What are 2D transforms in CSS3?

Ans:

In CSS3, by using 2D transforms we can re-change the element structure as translate, rotate, scale, and skew.

68. What are the common values used in 2D Transforms?

Ans:

Here are the some commonly used values in 2D Transforms,
matrix(n,n,n,n,n,n) – Used to defines matrix transforms with six values
translate(x,y)- Used to transforms the element along with x-axis and y-axis
translateX(n) – Used to transforms the element along with x-axis
translateY(n) – Used to transforms the element along with y-axis
scale(x,y) – Used to change the width and height of element
scaleX(n) – Used to change the width of element
scaleY(n) – Used to change the height of element
rotate(angle) – Used to rotate the element based on an angle
skewX(angle) – Used to defines skew transforms along with x axis
skewY(angle) – Used to defines skew transforms along with y axis

69. What are 3D transforms in CSS3?

Ans:

By using 3D transforms, we can move element to x-axis, y-axis and z-axis.

70. What are the common values used in 3D Transforms?

Ans:

Here are the some commonly used values in 3D Transforms,
matrix3d(n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n) – Used to transforms the element by using 16 values of matrix
translate3d(x,y,z) – Used to transforms the element by using x-axis,y-axis and z-axis
translateX(x) – Used to transforms the element by using x-axis
translateY(y) – Used to transforms the element by using y-axis
translateZ(z) – Used to transforms the element by using y-axis
scaleX(x) – Used to scale transforms the element by using x-axis
scaleY(y) – Used to scale transforms the element by using y-axis
scaleY(y) – Used to transforms the element by using z-axis
rotateX(angle) – Used to rotate transforms the element by using x-axis
rotateY(angle) – Used to rotate transforms the element by using y-axis
rotateZ(angle) – Used to rotate transforms the element by using z-axis



 

71. What are the CSS3 Animations?

Ans:

In CSS3 Animation is process of making shape changes and creating motions with elements.
@keyframes – Keyframes will control the intermediate animation steps in CSS3.

72. How can you create Multi Columns in CSS3?

Ans:

In CSS3, Multi Columns feature allows users to create, text as news paper structure in multi columns.

73. What are the values associated with multi columns?

Ans:

Here is the list of most commonly used multi column values, they are:
column-count – Used to count the number of columns that element should be divided
column-fill – Used to decide, how to fill the columns
column-gap – Used to decide the gap between the columns
column-rule – Used to specifies the number of rules
rule-color – Used to specifies the column rule color
rule-style – Used to specifies the style rule for column
rule-width – Used to specifies the width
column-span – Used to specifies the span between columns

74. Can you write CSS3 code to arrange text in multi columns?

Ans:

Here is the code for arranging text in multi columns,

<style>
.div1 {
width: 300px;
height: 100px;
border: 1px solid blue;
box-sizing: border-box;
}
.div2 {
width: 300px;
height: 100px;
padding: 50px;
border: 1px solid red;
box-sizing: border-box;
}
</style>

 

75. What is CSS3 Outline offset?

Ans:

CSS3 outline, draws a line around the element at outside of boarder.
Sample Code for creating Outline:

<style>

div {

margin: 20px;

padding: 10px;

width: 300px;

height: 100px;

border: 5px solid pink;

outline: 5px solid green;

outline-offset: 15px;

}

</style>

 

76. What is Box sizing property?

Ans:

Box sizing property is using to change the height and width of element.
Example Code for CSS3 Box sizing:

<style>
.div1 {
width: 300px;
height: 100px;
border: 1px solid blue;
box-sizing: border-box;
}
.div2 {
width: 300px;
height: 100px;
padding: 50px;
border: 1px solid red;
box-sizing: border-box;
}
</style>

77. What is CSS3 Responsive Web Design?

Ans:

CSS3 Responsive web design provides an optimal experience for the user. Responsive design allows users easy reading and easy navigation with a minimum of resizing on different devices.
The best thing about web responsive design is, it will changes the height and width of the website automatically to fit the device screen (desktop, laptop, tablets and mobiles) to provide best user experience to the user.

78. What is CSS unicode-bidi Property?

Ans:

The unicode-bidi property is used together with the direction property to set or return whether the text should be overridden to support multiple languages in the same document.
CSS unicode-bidi property example:

div {
direction: rtl;
unicode-bidi: bidi-override;
}

79. What is CSS transition-timing-function Property?

Ans:

The transition-timing-function property specifies the speed curve of the transition effect. This property allows a transition effect to change speed over its duration.
Example:

div {
transition-timing-function: linear;
}

80. What is CSS text-indent Property?

Ans:

The text-indent property specifies the indentation of the first line in a text-block.
Example:

p {
text-indent: 50px;
}



 

81. What is CSS transform-origin Property?

Ans:

The transform-origin property allows you to change the position of transformed elements. 2D transformations can change the x- and y-axis of an element. 3D transformations can also change the z-axis of an element.
Example:

div {
transform: rotate(45deg);
transform-origin: 20% 40%;
}

82. What is CSS hanging-punctuation Property?

Ans:

The hanging-punctuation property specifies whether a punctuation mark may be placed outside the line box at the start or at the end of a full line of text.
Example:

p {
hanging-punctuation: first;
}

83. What is CSS counter-increment Property?

Ans:

The counter-increment property increases or decreases the value of one or more CSS counters. The counter-increment property is usually used together with the counter-reset property and the content property.
Example:

body {
/* Set “my-sec-counter” to 0 */
counter-reset: my-sec-counter;
}
h2:before {
/* Increment “my-sec-counter” by 1 */
counter-increment: my-sec-counter;
content: “Section ” counter(my-sec-counter) “. “;
}

84. What is CSS background-attachment Property?

Ans:

The background-attachment property sets whether a background image scrolls with the rest of the page, or is fixed.
Example:

body{
background-image: url(“img_tree.gif”);
background-repeat: no-repeat;
background-attachment: fixed;
}

85. What is CSS backface-visibility Property?

Ans:

The backface-visibility property defines whether or not the back face of an element should be visible when facing the user. The back face of an element is a mirror image of the front face being displayed. This property is useful when an element is rotated.
Example:

#div1 {
backface-visibility: hidden;
}
#div2 {
backface-visibility: visible;
}

86. What are CSS functions?

Ans:

CSS functions are used as a value for various CSS properties.
attr()
calc()
cubic-bezier()
hsl()
hsla()
linear-gradient()
radial-gradient()
repeating-linear-gradient()
repeating-radial-gradient()
rgb()
rgba()
var()

87. What is CSS attr() funtion?

Ans:

The attr() function returns the value of an attribute of the selected elements.
Example:

a:after {
content: ” (” attr(href) “)”;
}

88. What is CSS calc() function?

Ans:

The calc() function performs a calculation to be used as the property value.
Example:

#div1 {
position: absolute;
left: 50px;
width: calc(100% – 100px);
border: 1px solid black;
background-color: yellow;
padding: 5px;
text-align: center;
}

89. What is the cubic-bezier() function?

Ans:

The cubic-bezier() function defines a Cubic Bezier curve.
Example:

div {
width: 100px;
height: 100px;
background: red;
transition: width 2s;
transition-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1);
}

90. What is the CSS3 hsl() function?

Ans:

The hsl() function define colors using the Hue-saturation-lightness model (HSL). HSL stands for hue, saturation, and lightness – and represents a cylindrical-coordinate representation of colors.
Example:
#p1 {background-color:hsl(120,100%,50%);} /* green */
#p2 {background-color:hsl(120,100%,75%);} /* light green */
#p3 {background-color:hsl(120,100%,25%);} /* dark green */
#p4 {background-color:hsl(120,60%,70%);} /* pastel green */


 

91. What is CSS3 hsla() Function?

Ans:

The hsla() function define colors using the Hue-saturation-lightness-alpha model (HSLA). HSLA color values are an extension of HSL color values with an alpha channel – which specifies the opacity of the color.
Example:
#p1 {background-color:hsla(120,100%,50%,0.3);} /* green */
#p2 {background-color:hsla(120,100%,75%,0.3);} /* light green */
#p3 {background-color:hsla(120,100%,25%,0.3);} /* dark green */
#p4 {background-color:hsla(120,60%,70%,0.3);} /* pastel green */

92. What is CSS linear-gradient() Function?

Ans:

The linear-gradient() function sets a linear gradient as the background image. To create a linear gradient you must define at least two color stops.
Example:

#grad {
background: linear-gradient(red, yellow, blue);
}

93. What is CSS radial-gradient() Function?

Ans:

The radial-gradient() function sets a radial gradient as the background image. A radial gradient is defined by its center. To create a radial gradient you must define at least two color stops.
Example:

#grad {
background: radial-gradient(red, green, blue);
}

94. Explain the CSS “box model” and the layout components that it consists of. Provide some usage examples.

Ans:

The CSS box model is a rectangular layout paradigm for HTML elements that consists of the following:
Content – The content of the box, where text and images appear
Padding – A transparent area surrounding the content (i.e., the amount of space between the border and the content)
Border – A border surrounding the padding (if any) and content
Margin – A transparent area surrounding the border (i.e., the amount of space between the border and any neighboring elements)
Each of these properties can be specified independently for each side of the element (i.e., top, right, bottom, left) or fewer values can be specified to apply to multiple sides. For example:
/* top right bottom left */
padding: 25px 50px 75px 100px;

/* same padding on all 4 sides: */
padding: 25px;

/* top/bottom padding 25px; right/left padding 50px */
padding: 25px 50px;

/* top padding 25px; right/left padding 50px; bottom padding 75px */
padding: 25px 50px 75px;

95. Explain what elements will match each of the following CSS selectors:

div, p
div p
div > p
div + p
div ~ p

Ans:

div, p – Selects all

elements and all

elements
div p – Selects all

elements that are anywhere inside a

element
div > p – Selects all

elements where the immediate parent is a

element
div + p – Selects all

elements that are placed immediately after a

element
div ~ p – Selects all

elements that are anywhere preceded by a

element

96. Explain the meaning of each of these CSS units for expressing length:

cm
em
in
mm
pc
pt
px

Ans:

cm – centimeters
em – elements (i.e., relative to the font-size of the element; e.g., 2 em means 2 times the current font size)
in – inches
mm – millimeters
pc – picas (1 pc = 12 pt = 1/6th of an inch)
pt – points (1 pt = 1/72nd of an inch)
px – pixels (1 px = 1/96th of an inch)