InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
Name the types of CSS3 positions and explain them? |
|
Answer» CSS can be written in three different ways for an HTML file.
The best way to write CSS by having an external document and linking it in the REQUIRED HTML documents. Whereas the reason why having an external document is best because having our CSS written inline it should be rewritten for ANOTHER element too lots of same code comes up. Whereas CSS is embedded in a style tag we cannot use the styles in a different HTML document again the code should be rewritten in different HTML document too. So, the best way is to use an external document to write CSS and link it in an HTML document. Ex:
The inline one is written along with the HTML element encapsulated in the body tag. And, the embedded style is written in the style tag encapsulated inside the head tag. And, the external style sheet named main.css is LINKED using link tag. |
|
| 52. |
Difference between CSS and CSS3? |
|
Answer» CSS3 position property allows us to position an element. The types of property values available for a position are STATIC, absolute, fixed, relative, sticky, INITIAL, and INHERIT.
|
|
| 53. |
What’s new in CSS3? |
||||||||||||||
Answer»
|
|||||||||||||||
| 54. |
How to render the first letter of a paragraph with red color & red border? |
|
Answer» CSS3 is the latest evolution extending CSS2. It has a lot of NEW features like selectors, rounded corners, border-IMAGE, text-shadow, box-shadow, transitions, animations, gradients, and grid layouts. Let us discuss each of them below.
|
|
| 55. |
object-fitfont-variation-settingstransformopacty |
|
Answer» Pseudoclass :first-LETTER can refer to the first letter of the element, PARAGRAPH as below. It is clean approach WITHOUT enclosing the first letter in SPAN tag and applying the required rule based on the representation. HTML <p>Booker T</p>CSS html { font-size: 3rem; } p::first-letter { border: 1px solid; font-weight: bold; color: red; } |
|
| 57. |
What are the different ways to define color? |
|
Answer» Colors in CSS can be specified by the following six methods: |
|
| 58. |
How to style the first line of the paragraph as uppercase? |
|
Answer» The :first-line pseudo-element is USED to STYLE the first formatted line of a paragraph by using text-transform property with VALUE uppercase. |
|
| 59. |
How to write media queries for a device with aspect ratio 16/9? |
|
Answer» The aspect ratio is DEFINED as the ratio of WIDTH media feature to the ratio of height media features W:H. And the aspect ratio 16/9 is 42:32. The below Media query allows to TARGET the media query BASED on device-aspect-ratio which is 16/9. @media screen and (device-aspect-ratio: 16/9) { /* Your CODE here */ } |
|
| 60. |
What are conditional comments? |
|
Answer» CONDITIONAL comments are developed by microsoft. And it only worked with IE BROWSER. The conditional comments help to target IE browser & comments can be written to target the different version of IE 5-IE 9. CSS RULES or code embedded inside of the comments will be used by Internet explorer BASED browser. Whereas from IE10 & above the support for conditional comments has been dropped. <p class=“conditional-comments“> <!--[if IE]> According to the conditional comment this is IE<br /> <![endif]--> <!--[if !IE]> --> According to the conditional comment this is not IE 5-9<br /> <!-- <![endif]--> </p> |
|