Changing Background and Color of Main Content



Changing background






  • Apply to the div id="main-content" (this section)
  • Change the background-color (#CCFFFF)
  • Inserting a picture at the top of the section with these CSS clauses :

#g_body

{

background-image: url(url of the picture);
background-position: top center;
background-repeat: no-repeat;
background-attachment: scroll;

}

(Minor differences between IE 6 and FF 2, title Changing background is under the picture with FF)


  • Add this to the first section of the page (after the header) :

<script language="Javascript" type="text/javascript">
var cssNode = document.createElement('link');
cssNode.type = 'text/css';cssNode.rel = 'stylesheet';
cssNode.href = 'http://SITENAME.googlepages.com/CUSTOM_SHEET.css';
cssNode.media = 'screen';
cssNode.title = 'change background';
document.getElementsByTagName("head")
[0].appendChild(cssNode);

</script>



Changing Color of Background


  • Click on the color :
.
.
.
.
.
.
.
.
.
.


  • Just define the color for the body :


body
{
background-color: #xxxxxx;
}



Changing Background of Container


  • Change the CSS for id #container


#container
{
background-image: url(url of the picture);
background-repeat: repeat-y;
background-position: left top;
}


A Background for a div block


  • We create a div block and define a background :


.divback {

background-image: url(url of the picture);
background-position: top center;
background-repeat: repeat-y;

border: solid 2px #7b84af;

width: 470px;

}


  • The result :










The Background Problem


  • Most of the GPC templates use picture to define the background
  • In the default CSS we can find :

background:
url(/-/includes/style/x1/x2/x3.gif) position;
  • To change the color of background or the width of sections, we need to change these pictures. To download a picture, use this address :

http://YOURSITE.googlepages.com/-/includes/style/x1/x2/x3.gif
  • With a graphical tool, we can change the picture, and upload the new one into GPC. To use it in CSS, we use then this address :


background:
url(http://YOURSITE.googlepages.com/new_x3.gif) position;


  • Note : Some template, use by mistake /include/ as subdirectory (without s)



Some examples



    Micro Cookies Template- Green Variation




    Using a picture as background


More Informations






One Day - One Label - One Wine

Add this Gadget to Google - Every day a new label - discover new wines



Les plus beaux domaines viticoles du Pays de Vaud, les images des Clos, Domaines et Châteaux :

Les images des Clos, Domaines et Châteaux



Find a Wine with Google CSE


Add this gadget to Google