English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi. I have a stylesheet in which I want to add the website header and a photo that will then appear on every page of my site. I have tried using the background-image declaration but for me it doesn´t work. Apart from wanting the header (a .gif) and the photo on each page, I also want to make some text, a backbutton and the menu appear on each page. I am new to CSS and basically, just need to find out how to write/input these items just ONCE in the stylesheet instead of having to repeat the same thing on each page.

Many thanks for your help.

2007-12-08 06:28:08 · 5 answers · asked by animalita40 1 in Computers & Internet Programming & Design

5 answers

This code will set up a 2 column layout on your page. It will also include a header element at the top where you can insert an image to be displayed on evry page

By altering the body element tag the whole document will adopt these changes, you can alter each part of the page by changing the colour in each div.

body{
border:0px;
margin:0px;
padding:0px;
height: 100%;
background: #F9FFFF;
}
#masterhead {
margin: 0px;
height: 30%;
padding:0px;
background-image: url(yourimage.gif); // see notes
background-position: absolute; 0% 0%;
background-repeat: no-repeat;
background-attachment:scroll;
}
#content{
margin: 20px 20px 20px 160px;
padding: 20px 20px 0 20px;
}
#sidebar{
position:absolute;
left:20px;
width:200px;
margin-top: -20px;
margin-bottom:10px;
padding:10px;
}
#footer{
width:100%;
height:35px;
margin:0;
}

NOTES

you will have to save your image to the size that you need as you can't set the size using css.

HTML code


anything you want to apper in the head of the document


fedest.com, questions and answers