.
Previous

Interview Questions on CSS

51. How to keep scroll bar for div or body?

Use :-
overflow-x: scroll; /* to set scroll bar in X direction */
overflow-y: scroll; /* to set scroll bar in Y direction */

52. How to hide scroll bar for div or body?

overflow: hidden; 
53. How to apply styles for screen which has screen size  more than 250px;
Syntax :- 
@media only screen and (min-width:250){
      /*styles goes here */
}
Example :-
@media only screen and (min-width:250){    
 .container{
    width:200px;
    font-size:12px; 
 }
 p{
     Font-size:10px;
 }
}

54. How to apply styles for screen which has display less than 1000px;

Syntax :- 
@media only screen and (max-width:1000){
      /*styles goes here */
}
Example :-
@media only screen and (max-width:1000){
.container{
   width:900px;
   font-size:18px; 
}
p{
    Font-size:12px;
}
}

Previous