Interview Questions on CSS
21. How to write background image for div?
Use background-image attribute. Ex:- div{ background-image : url(‘link_of_image’); }
22. How to set background colors?
Use background-image attribute. Ex:- div{ background-color : #FF4567; }
23. How to repeat the same in x-direction for background image in div?
Use background-repeat: repeat-x;
24. How to repeat the same in y-direction for background image in div?
Use background-repeat: repeat-y;
25. How to repeat the same in X and y-direction for background image in div?
Use background-repeat: repeat;
26. By default in which direction repetition of background image exist ?
In both directions
27. How to set to not repeat the background image?
background-repeat: no-repeat;
28. How to apply style for only last row of table?
tr : last-child { /* Apply styles here */ }
29. How to apply style for only first child of list?
tr : first-child { /* Apply styles here */ }
30. Which property we use to not allow the user to modify the input value?
Use disabled in input tag. EX:- <input type=”text” value=”33” disabled />