Code for adding a background image to the top of the homepage

Source: Internet
Author: User

During festivals, we often see some portal websites with a large webpage background added to the top, and some with the function of disabling them, not only adding an atmosphere to the festival, but also gaining praise from visitors. On the eve of the New Year's Eve, the customer's house has prepared some background material images and PSD files for you. If you need them, please download them here. Considering that many of my friends won't use it, I have specially organized a tutorial and hope you will like it.

In theory, this tutorial is generally used to add backgrounds on top of all websites. It will not be repeated here.

First, download the clip file.

Step 1:

Upload the selected style image to the "your website/image directory" Directory (for example, the path of the/images/or DZ forum is usually/static/image/common)

Step 2:

Find the CSS file of your website. For example, the path of the DZ forum is:/template/default/common/common.css.

Body {BGCODE };}

To:

/* Body {BGCODE };}*/

Body {background-image: url ({your website/image directory/shengdan.jpg); background-position: top center; padding-top: 80px; background-repeat: no-repeat ;}

Here we take the DZ Forum as an example. You only need to add the above red code to any position in CSS for your website. Pay attention to modifying the image path of the above blue text! In this way, it is generally done. If you modify the forum or CMS, you need to take the third step.

Step 3

Update cache or generate homepage in the background. OK!

Thank you again for your support and love for the powerful 91 fire 55 network. We will provide you with better original tutorials and wish you a Happy New Year and all the best!

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.