John Livermore
John Livermore

Reputation: 31313

background image not showing in div

I am not able to have a background image show in a div. See this fiddle. Can someone show me where I am going wrong please? This seems like a simple thing to do.

Upvotes: 2

Views: 5992

Answers (3)

Zeta
Zeta

Reputation: 105876

Add height:32px; and width:32px; to show one arrow (JSFiddle). The height of a div is determined by its content, so if you want to render the background of a container either specify its height or fill it with content.

Upvotes: 2

Scott
Scott

Reputation: 21882

You simply need a height for the div if you wish to see it.

Divs automatically have 100% width and 0 height.

See what happens when you add height.

Upvotes: 8

CanSpice
CanSpice

Reputation: 35790

Your div is empty. Put some text in it, and the background image will appear.

Alternatively, give your div a height.

Upvotes: 3

Related Questions