Adding background image control to a component requires only two steps: <View className="gifts" style={{ background: `url(${baseUrl}starMove/exclusiveEntrance/card.png) no-repeat`, backgroundSize: '100% 100%', }} > <View classname="gift-lists"></View> </View> Set background and backgroundSize. style={ width: 100%; height: 100%; } ps: Here is how to use CSS file to make the background image size adapt to the size of div Setting the background image attribute: background-size: cover; can make the background image adapt to the size of the div. background-size has 3 properties:
Summarize This is the end of this article about the implementation code of setting div background image with CSS. For more relevant CSS div background image content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! |
>>: SQL implementation of LeetCode (182. Duplicate mailboxes)
Docker is being used in more and more scenarios. ...
Note: nginx installed via brew Website root direc...
1. The ul tag has a padding value by default in M...
letter-spacing property : Increase or decrease th...
What you will create In this new tutorial, we'...
1. First register your own dockerhub account, reg...
1 Question The company's server uses Apache, ...
This article example shares the specific code of ...
Html event list General Events: onClick HTML: Mous...
An interesting discovery: There is a table with a...
Table of contents 1. How to switch 2. Dynamically...
This article is a MySQL configuration file soluti...
Table of contents Preface: 1. Default value relat...
Preface The master-slave replication relationship...
This article introduces several methods of implem...