- Requirements: Need to display the effect of a picture on a webpage?
➢ Method 1: Just write the img tag directly
• The img tag is a tag, if you do not set the width and height, it will be displayed in the original size by default
➢ Method 2: div tag + background image
• You need to set the width and height of the div , because the background image is only a decorative CSS style and cannot stretch the div tag.
img is used to realize more important pictures, such as product promotion pictures;
the background picture is not important, it plays the role of modification and beautification, and does not affect the use of functions.
- img
- background image