CSS 3 Interview Questions and Answers (122) - Page 4

Bootstrap supports two most popular CSS pre-processors.One is Less and what is the other ?

NOTE: This is objective type question, Please click question title for correct answer.
What is the Typing Discipline of Less CSS ?

NOTE: This is objective type question, Please click question title for correct answer.
What is the software license of Less CSS ?

NOTE: This is objective type question, Please click question title for correct answer.
How do we change font text and size of text? How do we create format text in italic and bold style?

For changing font,
font-family: Arial, Verdana;


For changing size of the text,
font-size: 20px;


To create format text in italic style,
font-style: italic;


To create format text in bold,
font-weight: bold;

How to change appearance of an Anchor Tag?

Write below css class:-
<style type="text/css">

a,a:link
{
color: #000000;
}
</style>

Note:- This will apply to all anchor tags on the page.
How to remove Underline from an Anchor Tag?

Use text-decoration style property inside css class as:-
text-decoration has none value.
<style type="text/css">

a,a:link
{
text-decoration:none;
}
</style>

How to provide underline on anchor tags when mouse is put on anchor tag?

Use hover class and inside hover class use text-decoration in-built css property and give it an underline value.
<style type="text/css">

a:hover
{
text-decoration:underline;
}
</style>

How to provide active or selected links a color on anchor tags?

Use active class and inside this class provide any color code as follows:-
<style type="text/css">

a:active
{
color:blue;
}
</style>

How to provide a visited links a color on anchor tags if a user has already visited the links?

Use visited class and inside this class provide any color code as follows:-
<style type="text/css">

a:visited
{
color:red;
}
</style>

How to place any image on anchor tags?

Use below css class code as follows:-
<style type="text/css">

a
{
padding-left: 20px;
background-image: url(view.png) no-repeat;
}
</style>

Note:- This will appear next to your links.
Which condition or property is used to stop images from showing up more than once when applying background image to any element?

no-repeat property or we can say that condition is used with background image style property.
For Example:-
background-image: url(view.png) no-repeat.

How do we execute a javaScript function on focus of the element?

Here in this we have a textbox with onfocus event.When we focus(means when we place the cursor)on the textbox ,GetFocus executes that recieves the id of the textbox In this function, we are finding the texbox (using its id passed in to function) and setting its background color to “blue”.

example:

Enter your name: <input type="text" name="txtName" id="txtName" onfocus="GotFocus(this.id)" />

<input type="button" id="btn" name="btn" value="Submit" />
<script type="text/javascript">
function GotFocus(id) {
document.getElementById(id).style.background = "#c0c0c0";
}
</script>

How do we execute a function when an element loses focus?

Here on the text box lose focus, we should create onblur event fires and we should execute callfuncton and we should set a background color for text box to highlight
example:

Enter your name: <input type="text" name="txtName" id="txtName" onblur="CallFunction(this.id)" />

<input type="button" id="btn" name="btn" value="Submit" />
<script type="text/javascript">
function CallFunction(id) {
document.getElementById(id).style.background = "blue";
}
</script>

Which style property takes element spaces on page when completely hides?

NOTE: This is objective type question, Please click question title for correct answer.
What is the syntax of Opacity in CSS3?

We can write below syntax in the element as:-
style="opacity:0.4;filter:alpha(opacity=40)"

Firefox uses the property opacity:x for transparency,while IE uses filter:alpha (opacity=x).
What do we mean by Opacity in CSS3?

Opacity is a style property used to show or hide the html element.
For example 0 for hide and 1 for show.
<p style="opacity: 0">Show Me</p> //will not show on the page
<p style="opacity: 0.5">Show Me</p>
<p style="opacity: 1">Show Me</p>

The Opacity declaration sets how opaque an element is.An opacity value of 1 means the element is fully opaque.An
opacity value of 0 means an element is not at all opaque, i.e. fully transparent.This elements opacity is 0.5!
Note that both the text and the background-color are affected by the opacity level.
Tell about some limitations of style sheets?

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.
Which tag is used to draw a horizontal row below a text in CSS?

NOTE: This is objective type question, Please click question title for correct answer.
Which tag used for an inline Frame?

NOTE: This is objective type question, Please click question title for correct answer.
What do we mean by Cell Padding?

NOTE: This is objective type question, Please click question title for correct answer.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories