Traditional Culture Encyclopedia - Traditional festivals - How to embed small things in web pages for decoration?
How to embed small things in web pages for decoration?
1, there are two ways to insert the background image, one is to use the img tag of html, and the other is to use the background tag of css. The specific operation is to create a new html file and write two DIVs to demonstrate two ways to insert tags:
2. First, insert an image with an html tag. Here, you can directly use the src attribute in the img tag to insert the image path.
3. Then insert it with css, set the class attribute to img2 in div, and insert it with background tag in script tag, where url is the path of the tag, no-repeat is to set the picture not to repeat, and center is to set the picture to be displayed in the center:
Finally, set some styles for these labels to make them look beautiful. Then open the browser to see the effect:
5. Open the browser and you can see that the photos are displayed. The above is an introduction to the method of html inserting photos:
- Previous article:What's with the big fan
- Next article:What are the science and engineering majors?
- Related articles
- What glue does the uneven toilet plug use?
- Is it a cultural lag or a decadent culture?
- What basic principles should villagers' autonomy follow?
- What are the specialties in Hong Kong, mainly for food and use?
- What are the folk arts in China
- Test questions of computer network security knowledge contest
- The table manners of business secretary
- Fun with sandbags kindergarten lesson plans
- Where is a good selling point in Tianjin?
- Original Tanabata and Translation Notes