Background in CSS: the problem that the url (image) cannot be displayed

Source: Internet
Author: User

Just encountered a strange problem, such a piece of CSS code:

Background: url (images/bg/bg1.gif) no-repeat;

This Code does not show any background image, but collapsed...
The code is certainly okay. Even if I haven't located the background image, I will not consider it for the moment, because I don't have this problem here... As a result, I searched Google and found many people with this problem... But there is not much information that really points out the problem...

What are the real problems?

The background file and background image are stored in the images directory of the same level as the style directory. Therefore, the CSS here should be written as follows:

Background: url (../images/bg/bg1.gif) no-repeat;

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.