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

When using the padding property; are you allowed to use negative values?

2

How do you make a list that lists its items with squares?

3

How do you select an element with id "demo"?

4

How do you select elements with the class name "test"?

5

How do you select all p elements inside a div element?

Comments