CSS is very powerful. It provides very powerful functions for element performance and page layout. This mainly lies in our flexible operation, in this regard, rich and valuable tutorials and information are provided. The use of images is actually more at the content layer. According to the concept of the Web standard, the pictures on the presentation layer have been separated into CSS. Only images that serve as content can be inserted to the page using the IMG tag. This is also the semantics that has always been emphasized.
Setting a background image for an image is a very interesting example. This sentence may seem a little fun. We set a background image for the image that is introduced to the page using the IMG label. Such an application may not be very wide, but it can train your thinking and help you understand the meaning and flexibility of elements in HTML and CSS.
Let's take a look at the followingCode.
This is to introduce the image to the page using the IMG label.
Let's write CSS again.
IMG {
Display: block;
Width: 443px;
Height: 60px;
Padding-bottom: 10px;
Background: url(jb52bg.jpg) No-repeat left bottom;
}
Convert the IMG element to a block element and set the width and height. Set the bottom margin to 10px. Reserve a certain amount of space for the displayed background image. Finally, define the background image.
From this small example, we can see that CSS is flexible and powerful.