Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a background 1

Status
Not open for further replies.

Gatorajc

MIS
Mar 1, 2002
423
US
Is there a secret to creating a background. I have an image I want use but for some reason. it appears a few times. Is there a certain size I have to make the image. Stupid question I know but I never made my own background before. As you can tell Im not a graphics person. AJ
I would lose my head if it wasn't attached. [roll1]
 
there's no particular secret to making a background image. most image creation apps will have predefined sizes for you to work in but any image can be used for a background. If a image is smaller then the screen and is reating as it sound like you're getting jsut set the background via css like this
<STYLE TYPE=&quot;text/css&quot;>
BODY { background-repeat:no-repeat;background-attachment:fixed;background-position:center center;background-image:url(&quot;&quot;) }
</STYLE>

this will center and fix with no repeating.
you can also have a function onLoad to find the size of the users screen and fit the background per that resolution. something like
x = screen.width ; y = screen.height
if ((x >= 800) && (x <= 1028)) { x = 1028 }
if ((y >= 600) && (y <= 780)) { y = 780 }
if ((x >= 640) && (x <= 800)) { x = 800 }
if ((y >= 480) && (y <= 600)) { y = 600 }

thus now having a numeric width and height to set the image per that users settings


A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
Thanks helpful as always.
AJ
I would lose my head if it wasn't attached. [roll1]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top