HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

Chapter 31


Backgrounds


Contents


31.1 Background Image (URL)............. 274
31.2 Opacity........................ 275
31.3 Gradients....................... 275
31.4 Overlapping Backgrounds............. 275

transparency fixed repeat-x tiled 100% auto background-image image at-
tachment


31.1 Background Image (URL)


You can specify the background image behind text by writingbackground-image: url('xxx');
where the xxx is replaced by the URL for your picture.


The image will extend through the padding and border areas, but not into
the margin.


More than one image can be specified. (Separate the URLs by commas.)
They will be layered.


The images can be partly transparent. This can be accomplished by using
an alpha channel on the image itself. It can also be accomplished by using
an opacity setting.


http://www.w3schools.com/cssref/pr_background-image.asphas more.


274

Free download pdf