Home>Article>Web Front-end> How to set DIV background image background

How to set DIV background image background

php中世界最好的语言
php中世界最好的语言 Original
2017-11-21 14:08:45 7803browse

How to set the background image of DIV? Today we will explain in detail how to set the DIV background imagebackgroundand how to set the DIV background image.

What does Background mean? It means background when translated. Also in css, as a member of the css attribute, it also has the meaning of background, and it is used to set the background image, background color, background image interception and other styles.

First of all, let’s take a look at the values of background (you can enter the background of the CSS manual to learn more)

You can set the following properties in order (you can click to enter the corresponding CSS manual to view and use):

background-colorBackground color

background-imageBackground image

background-repeatBackground repeat

background-attachmentIs the background image fixed or scrolling

background-positionThe positioning of the background image

Next we focus Let’s explain the common usage of css background

First let’s look at the following piece of code

background:url(bgimg.gif) no-repeat 5px 5px;

From the picture From the CSS background analysis diagram, we can learn more about how to use the background css attribute.

background:url(bgimg.gif) no-repeat 5px 5px; Such css background expression can save and optimize css file code.

Learners can use and test the various properties of the background to understand and master the css background

How to set the DIV background image background. Friends who need it can save it. Please continue to pay attention to this article. Other updates to the site.


Related reading:

How to set the link style with CSS


##How to write a dotted border with css


##How to remove the underline of a hyperlink in css

The above is the detailed content of How to set DIV background image background. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn