How to design a large background web page with CSS

Source: Internet
Author: User
Tags wrapper

Since I published a large background page design collection, I received a lot of emails asking how to use CSS to achieve a large background of the Web page design. So I decided to share with you the design techniques of the big background site. In this tutorial, I'll use some examples to illustrate how to design a large background site with one or two pictures.

Mistakes that are often made: backgrounds are cut (see sample)

Look at the sample file, which is no problem when the resolution is less than 1280. But if your display has a resolution greater than 1280 pixels, you will see a portion of the background image.

Example 1: A picture (see sample)

Simple way to fix the problem: set the color of the edge of the picture to the same color as the background of the page. Here I use the web Designer wall as an example, look at the picture below, note that the edge of the picture is solid color.

CSS Section

This section is simple, set the background image for the BODY element (located in Center,top)

Here is the CSS code:

Body {
padding:0;
margin:0;
Background: #f8f7e5 URL (wdw-bg.jpg) no-repeat Center top;
width:100%;
display:table;
}

Notice that there are two extra lines in the body selector to prevent the background image from changing when the browser window is smaller than the content width. (this will appear in Firefox)

Example 2: Two pictures (see sample)

I'm going to use the design Jobs on the wall as an example, I've applied a duplicate soft plank pattern to the body tag, and then applied a centered background pattern to the wrapper tag.

The trick here is to use a similar but darker color for the GIF image as the cork background.

Example 3: Sky background (see sample)

In this example, I applied a 1 pixel horizontal gradient to the body tag. Then I added a centered cloud background picture to the wrapper tag.

Update: Apply a Sky background picture to an HTML selector (see sample)

Thanks to the reader's comments, the following is a more concise way to apply a gradient background to the HTML selector, so the wrapper tag is no longer needed.

SOURCE Link: how To:css Large Background

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.