Tag: web technology

Questions Related to web technology

  1. Which HTML attribute is used to define inline styles?
  1. style

  2. font

  3. class

  4. styles


Correct Option: A
Explanation:

The correct answer is A. "style" is the HTML attribute used to define inline styles. This attribute is applied directly to the HTML element and allows you to specify CSS styles for that particular element.

Let's go through the other options and explain why they are incorrect:

B. "font": This attribute is not used to define inline styles. It was commonly used in older versions of HTML to specify font-related styles, but it is now considered deprecated and should be avoided.

C. "class": The "class" attribute is used to define a class for an HTML element, which can be used to apply styles defined in CSS. However, it is not specifically used for defining inline styles.

D. "styles": This is not a valid HTML attribute. The correct attribute is "style".

So, the correct answer is A. "style".

  1. body {color: black}

  2. {body;color:black}

  3. {body:color=black(body}

  4. body:color=black


Correct Option: A

How do you insert a comment in a CSS file?

  1. // this is a comment

  2. /* this is a comment */

  3. // this is a comment //

  4. ' this is a comment


Correct Option: B

How do you add a background color for all

elements?

  1. h1 {background-color:#FFFFFF}

  2. all.h1 {background-color:#FFFFFF}

  3. h1.all {background-color:#FFFFFF}

  4. None of the above


Correct Option: A

How do you change the text color of an element?

  1. fgcolor:

  2. text-color:

  3. color:

  4. text-color=


Correct Option: C
  1. text-style

  2. text-size

  3. font-size

  4. font-style


Correct Option: C

How do you change the font of an element?

  1. font=

  2. f:

  3. font-family:

  4. None of the above


Correct Option: C
  1. style:bold

  2. font:b

  3. font-weight:bold

  4. None of the above


Correct Option: C