Hi,
I am very new to web design so please accept my apologies for what I'm sure is a very straight forward question.
I am trying to design a website for a friend with a specific picture at either side of the main body of the page which is 595 pixels wide. I know that I can use the css "background" property but that would mean that the picture is tiled across the background instead of being placed at either side of the page.
The idea is that the picture would be before the background only if the screen is wide enough.
From searching on the web, I have managed to make the picture appear to the right of the page using the following code:
and the body
I am currently using colours to help me to determine exactly which area I am working with and do not plan to use these in the final site.
I have tried replicating the "right-bg" code calling it "left-bg" and playing with the "left:" tag, trying to make it work but I cannot (as yet) make it appear.
I have attached a screenshot of how the layout currently looks. If the browser screen is smaller, the image is cropped. I would like to do the same to the left if that is possible.
Thank you for your help with what I'm sure is a very straight forward problem.
I am very new to web design so please accept my apologies for what I'm sure is a very straight forward question.
I am trying to design a website for a friend with a specific picture at either side of the main body of the page which is 595 pixels wide. I know that I can use the css "background" property but that would mean that the picture is tiled across the background instead of being placed at either side of the page.
The idea is that the picture would be before the background only if the screen is wide enough.
From searching on the web, I have managed to make the picture appear to the right of the page using the following code:
Code:
#main {
width: 900px;
height: 2000px;
margin: 0 auto;
background: blue;
position:relative;
text-align: center;
}
body {
background: red;
overflow-x: hidden;
}
#right-bg {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 900px;
width:595px;
background-image:url(image.png);
}
and the body
Code:
<div id="main">
<div id="right-bg"></div>
content
</div>
I am currently using colours to help me to determine exactly which area I am working with and do not plan to use these in the final site.
I have tried replicating the "right-bg" code calling it "left-bg" and playing with the "left:" tag, trying to make it work but I cannot (as yet) make it appear.
I have attached a screenshot of how the layout currently looks. If the browser screen is smaller, the image is cropped. I would like to do the same to the left if that is possible.
![Layout_zps5e944bc2.jpg](http://i1170.photobucket.com/albums/r534/damo331/Layout_zps5e944bc2.jpg)
Thank you for your help with what I'm sure is a very straight forward problem.