Novice basic learning: background image CSS in different locations of the wording

Source: Internet
Author: User
Tags address aliyun basic control different external file files

Intermediary trading http://www.aliyun.com/zixun/aggregation/6858.html"> SEO diagnostic Taobao customer hosting technology hall

This article is for novices, experts do not read.

When we make web pages, we sometimes add background images to the web pages to beautify the web pages

Now we make Web pages are generally used CSS to control the layout and page effects (css.css files are generally in the same folder with the picture file, and if the same as the Web page file on the outside, then this article No sense of meaning, Oh, we now have to talk about the index.htm file is not in the folder, but separately on the outside, so that visitors can directly access to, and CSS files and image files are on the same Folder, ie: images folder)

CSS according to their location can be divided into three types:

Inline Style

Internal Style Sheet (Internal Style Sheet)

External Style Sheet (External Style Sheet)

But different CSS location will lead to the background picture address written differently. Let's take a look at the manifestations of the three stylesheets below:

Internal style sheet:

External style sheet:

Webmaster learning network -www.zxx6.com

Inline style:

Webmaster learning network -www.zxx6.com

The external style and internal style image address should be correct, just write the name of the picture, and you have added in the location of the head of the page no problem, and now is the inline style of the problem, if you are just simple Use background-image: url (zxx6.jpg) this path, then the picture will not be displayed, only fill in the complete path is as follows (assuming the real address of the picture is: http://www.zxx6.com/images /zxx6.jpg)

Then we should write like this:

Webmaster learning network -www.zxx6.com

, Can show normally.

This is the same conditions, different styles of picture writing. One is the need to complete the picture path, one is because the CSS file in the htm file has a clear path, and do not need to be added again. If for a small page, using embedded style, fill in the full path of the picture, because the use of the picture is small, it does not matter, but for multiple pages, or use the external style is good.

Welcome to reprint this article, reprint, please indicate the way the link: Webmaster www.zxx6.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.