background - image property sets background image for element - HTML

Q.  Which CSS property sets a background image for an element?
- Published on 28 Aug 15

a. background
b. background - attachment
c. background - color
d. background - image

ANSWER: background - image
 

    Discussion

  • Nirja Shah   -Posted on 06 Nov 15
    background-image property
    - This property sets one or more background images for an element.

    - The total size of the element, including padding and border (but not the margin) is the background of an element.

    - By default, a background-image is placed at the top-left corner of an element, and repeated both vertically and horizontally.

    - Some of the properties of background-image are:

    Default value: none
    Inherited: no
    Animatable: no
    Version: CSS1 + new values in CSS3
    JavaScript syntax: object.style.backgroundImage="url(smiley.gif)"

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)