Web Design Workshop 16 — Scroll over Background

October 6, 2009
By

How to let your Con­tent Scroll over the Background

Scr5olling over a back­ground image may save resources, namely if you use a large back­ground pic­ture. Also it gives you more con­trol over the way your blog dis­plays on dif­fer­ent mon­i­tors and with dif­fer­ent res­o­lu­tion settings.

On my design blog you see an exam­ple.

Transparent WordPress scrolls over Background

Trans­par­ent Word­Press scrolls over Background

Back­ground CSS

CSS lets any ele­ment have a back­ground image and or color. Using the appro­pri­ate stan­dard prop­er­ties, you are in con­trol of the background.

Our Web design Work­shops 6 and 11 have already devel­oped the topic.

CSS Back­ground Properties

CSS goes beyond the back­ground atributes of HTML.

The CSS Back­ground Prop­er­ties are:

  • background-image
  • background-attachment
  • background-repeat
  • background-position
  • back­ground
  • background-color

Back­ground Attachment

In order to con­trol scrolling or not scrolling over the back­ground we need to define the back­ground attachment.

The background-attachment prop­erty can take two val­ues: scroll or fixed. The default value is “scroll” mean­ing that the back­ground scrolls with the content.

If we want to obtain a sta­tic back­ground and scroll con­tent dynam­i­cally over that back­ground, then we use the value “fixed”.

CSS Fixed Back­ground Exam­ple with Semi­oman­tics XO

On the men­tioned Design Blog, the body back­ground style is defined as follows:

body {
background: #fff2d4 url(images/wall1680c.jpg) repeat-x;
background-attachment: fixed;
margin: 0 auto;
padding: 0;
font-size: 14px;
color: #000125;
}

We are inter­ested in the fol­low­ing two lines:

background: #fff2d4 url(images/wall1680c.jpg) repeat-x ;
background-attachment: fixed;

As you see the back­ground color is defined with a color and an image (the color may load faster). The image has a width of 1680 pix­els. We tile the image hor­i­zon­tally for the case that vis­i­tors may use larger res­o­lu­tions than 1680 pix­els wide. Ver­ti­cal tiling is not really required as we scroll over the back­ground. (Of course some vis­i­tors with a mega screen may have a ver­ti­cal res­o­lu­tion big­ger than the 1250 pix­els of the image, but the bot­tom of the image fades into white).

The sec­ond line defines the back­ground attach­ment: here we use fixed.

Now our page con­tent scrolls over the background.

Note: Make sure your back­ground image is not too heavy! On the Design Blog I have reduced 4.5 MB to 130 KB which is still big but it opens fast enough with most visitor’s ADSL line.

Web Design Work­shop by Ycademy

Join tonight’s Ycad­emy Web Design Workshop16 at 8 pm GMT (Lon­don) where we will step by step apply the above. We will resize an image for the pur­pose of the back­ground and then edit the style sheet to imple­ment the fixed back­ground effect.

Incom­ing search terms:

Related posts:

  1. Design Graphic Background
  2. Web Design Work­shop 11 Background
  3. Web Design Back­ground Graphics
  4. Web Design Backgrounds
  5. Trans­par­ent Word­Press Theme Design

Tags: , , , , , , , , , ,

8 Responses to Web Design Workshop 16 — Scroll over Background

  1. WordPress Update – Webmaster Training on November 29, 2011 at 2:21 pm

    […] page is wiki editable click here to edit this page.Read also:Wave Sem­i­nar Hits Google Top 10Web Design Work­shop 16 – Scroll over Back­groundWeb­mas­ter Train­ing NextGen Gallery­Google Top 10 Dom­i­nate your Key­wordY­cad­emy Sem­i­nar: How to Build […]

  2. How to Customize WordPress | Friends on October 24, 2010 at 1:37 am

    […] Web Design Work­shop 16 – Scroll over Background […]

  3. WordPress 2.9 update on Semiomantics | Semiomantics on December 20, 2009 at 11:09 pm

    […] Web Design Work­shop 16 – Scroll over Background […]

  4. Semiomantics XO 2010 Edition | Web Design on December 10, 2009 at 1:14 am

    […] Web Design Work­shop 16 – Scroll over Background […]

  5. […] Web Design Work­shop 16 – Scroll over Background […]

  6. Transparent Backgrounds | Design on October 7, 2009 at 10:46 pm

    […] is why our Ycad­emy Train­ing yes­ter­day was so impor­tant as it taught all par­tic­i­pants how to decrease the weight of background […]

  7. Transparent Backgrounds | Bianca Gubalke on October 7, 2009 at 10:44 pm

    […] is why our Ycad­emy Train­ing yes­ter­day was so impor­tant as it taught all par­tic­i­pants how to decrease the weight of background […]

  8. […] Yorgo Nestoridis Media Mar­ket­ing Pub­lish­ing Skip to con­tent Home­About­Feeds and Archives­LinksPho­to­sWeb­mas­ter Train­ing August 22, 2009YORGOO Press GalleryCar­ni­val Gallery­Medi­aSo­cial Medi­aY­OR­GOO Media Con­fig­ure Atahual­pa­Make Money with Twit­ter Part 1Make Money with Twit­ter Part 2GalleryGlobal Sports Fun Adver­tis­ing­So­cial Net­work Pub­lish­ingNews­Cast­Semioman­tics XOYORGOO Press­Bianca Gubalk­eY­cad­emy Train­ing Cre­ate AdsAcrop­o­lis Muse­um­Global Sports Fun AdsT­wit­ter­So­cial Net­work Pub­lish­ing with News­Cast­Web­mas­ter Train­ing August 22, 2009Greece FiresY­cad­emy Sem­i­nar August 2009Vouliagmeni Beach­Semioman­tics XOC­Semioman­tics XO Media CMSWeb Design­Vou­liag­meni LakeWin­dows 7Web Design Work­shopArt­Gia­comet­ti­Mar­ket­ing­Busi­ness Build­ing­How to Build an Online Busi­nessHow to Build an Online Busi­ness 2How to build an Online Busi­ness 4How to Build an Online Busi­ness 5Global Sports USNike Kick­sWeb­mas­ter Train­ing August 22, 2009Online Adver­tisin­gOnline Adver­tis­ing 2Online Adver­tis­ing 3Online Adver­tis­ing 4ContactPublishingYORGOO PressY­OR­GOO PressSemioman­tic­sNews­Cast by Semi­oman­tic­sHosted Niche Sites « Web Design Work­shop 16 – Scroll over Background […]

Leave a Reply

Your email address will not be published. Required fields are marked *

*