The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Background Image Inside Border?

2 posters

Go down

Solved Background Image Inside Border?

Post by JDobbsy1987 April 20th 2010, 5:49 pm

Hi,

This is on a HTML page...

Can anyone help me with putting a background image within a border?

This is the code i currently have for the border:
Code:
<div style="width: 1050px; height: 940px; border: 3px solid black; color: Black;">...........</div>
i would now like to put an image within the border as a background for example - (this is just a picture from google for testing) http://www.greenpeace.org/international/assets/graphics/wp-gwt-ice-1024x768.jpg

If this is not possible then how would i set a background image for the whole page without it looking stupid such as scrolling down without the image duplicating?

basically i dont have a clue when it comes to setting a background Confused
JDobbsy1987
JDobbsy1987
Forumember

Male Posts : 147
Reputation : 0
Language : England (UK)
Location : Cheshire

http://www.JDobbsyFreeAds.darkbb.com

Back to top Go down

Solved Re: Background Image Inside Border?

Post by Guest April 20th 2010, 6:23 pm

try this code :

Code:
<div style="background-image: url( http://www.greenpeace.org/international/assets/graphics/wp-gwt-ice-1024x768.jpg); width: 1050px; height: 940px; border: 3px solid black; color: Black;">...........</div>

If you want your background image not repeat use this code

Code:
<div style="background-image: url( http://www.greenpeace.org/international/assets/graphics/wp-gwt-ice-1024x768.jpg);  background-repeat:no-repeat; width: 1050px; height: 940px; border: 3px solid black; color: Black;">...........</div>
avatar
Guest
Guest


Back to top Go down

Solved Re: Background Image Inside Border?

Post by JDobbsy1987 April 21st 2010, 9:50 am

Hi,

That is perfect thank you very much, just to add to this, i am sure its easy to do but how do i then make the page a different colour e.g. Navy Blue

This way i have a navy blue page but with the picture i select over it as a background so the edges are not white?

Once again thank you very much
JDobbsy1987
JDobbsy1987
Forumember

Male Posts : 147
Reputation : 0
Language : England (UK)
Location : Cheshire

http://www.JDobbsyFreeAds.darkbb.com

Back to top Go down

Solved Re: Background Image Inside Border?

Post by JDobbsy1987 April 21st 2010, 10:10 am

I have now sorted the background colour so all is good... Whoo hoo

Thank you for your help
JDobbsy1987
JDobbsy1987
Forumember

Male Posts : 147
Reputation : 0
Language : England (UK)
Location : Cheshire

http://www.JDobbsyFreeAds.darkbb.com

Back to top Go down

Solved Re: Background Image Inside Border?

Post by ankillien April 21st 2010, 10:20 am

Solved > Locked
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum