CSS Multiple choices


Total available count: 25
Subject - Web Development
Subsubject - CSS

Which property is used to change the left margin of an element?


 

 

 

 



A


Solution:-

CSS Margins:-
The CSS margin properties are used to create space around elements or each side of the elements, outside of any defined borders.

With CSS, you have full control over the margins. There are properties for setting the margin for each side of an element (top, right, bottom, and left).

All the margin properties can have the following values,

  1. auto - the browser calculates the margin
  2. length - specifies a margin in px, pt, cm, etc.
  3. % - specifies a margin in % of the width of the containing element
  4. inherit - specifies that the margin should be inherited from the parent element

Tip: Negative values are also allowed to margin properties.

Following example shows how to set different margins for all four sides of an <img> element,

img {
 margin-top: 50px;
 margin-bottom: 50px;
 margin-right: 50px;
 margin-left: 50px;
}

 




Next 5 multiple choice(s)

1

How do you display a border like this:
The top border = 10 pixels
The bottom border = 5 pixels
The left border = 20 pixels
The right border = 1pixel?

2

How do you make the text bold?

3

Which property is used to change the font of an element?

4

How do you make each word in a text start with a capital letter?

5

How do you display hyperlinks without an underline?

Comments