|
|
#1 | ||
|
Junior Member
Join Date: Sep 2009
Posts: 6
Thanks: 7
Thanked 0 Times in 0 Posts
|
Hi hope someone can help, I am new to web design and html but I have created an image in photoshop
and would like it to be my background image on my home page but when I put the html code that I think is correct the image falls short of filling the browser window and is aligned to the top left corner?? here is the code I am using <html> <head> <style type="text/css"> body { background-image:url('pic.psd'); background-repeat:no-repeat; } </style> </head> </html> |
||
|
|
|
|
|
#2 | ||
|
Member
Join Date: Jul 2009
Posts: 46
Thanks: 1
Thanked 3 Times in 3 Posts
|
This is likely part if not all of the problem, you really need to RTM.
You can do it with PhpHP I believe, but I would think that's beyond you for a while at least: Let me google that for you |
||
|
|
|
|
|
#3 | ||
|
Senior Member
Join Date: Aug 2009
Posts: 222
Thanks: 11
Thanked 12 Times in 12 Posts
|
say your image is for example 200x200 pixels. if your browser is 800x600 your background image wont stretch to that size. However if you want your image to to fill the page by repeating in your background, remove the 'no-repeat' style. Also like Arhiann said PSDs aren't the way to go about it. Jpeg, .jpg, .gif, .bmp, .png are the only image formats that will display in a browser as far as I'm aware.
|
||
|
|
|
|
|
#4 | ||
|
Junior Member
Join Date: Nov 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hi rgnau81,
What I would suggest doing is creating a background image that you can either "fade from" or "fade to". I.E., have a background image that has perhaps the colour blue in it (that you created in Photoshop) and then you can simply use the following CSS code: Code:
<html>
<head>
<style type="text/css">
body { background: #003366 url(mybackground.jpg) no-repeat 0 0; }
</style>
</head>
<body>
<h1>Some test text</h1>
</body>
</html>
Code:
<style type="text/css">body { background: #003366 url(mybackground.jpg) no-repeat 50% 0%; }</style>
Hope this helps answer your question a little bit. And also, the only supported image formats as background images are: .gif, .jpg, .png, .bmp (sugget not using bitmaps though - not exactly web friendly!) To save your file as a web file format, in photoshop select: File > Save For Web Or press the keyboard keys (Windows): CTRL + ALT + S You will then be able to preview the quality of the output image and save the file as either of the formats listed above |
||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|