|
Background Information
hey, gotta do a thorough criminal record check… |
|
Introduction Text Links Images Backgrounds Tables Colors Utilities and other tips |
|
We’re not paintin’ a picture here...
This is probably going to be the shortest section of the entire tutorial so we’re just gonna blaze right through it. You’ve got two options, one, use a color for your background, a solid color. Number two, use a picture. Either way, you gotta know how to make it work so we’ll dive right in. I’m antsy ta get you guys past this and the next section and on to colors so you know what values to use here and with various other attributes in HTML. Now, here we go... Body To actually change anything with the background, you have to do it in the <body> tag. This controls the page itself, how it looks, default attributes for various tags, etc. to edit the background, it’s really quite simple. Since it’s so easy, I’m going to just shove it all into one example and explain it piece by piece. This is a tag that contains the bulk of HTML coding you’ll do. There will be an example of how to use this and every other tag explained in this tutorial at the end. You do not close this tag until you reach the end of your block of code. This is usually at the end of the coded page.
Background To start off, the ‘background’ attribute is what you use if you want a picture for your background. If your image is smaller than the window, it will repeat it horizontally and vertically (tile it if you know what that means) to fill the space it doesn’t use. If you think this doesn’t happen and have a site where it APPEARS that it is shown only one time, trust me on this, it was created with enough monochromatic space (space used by one color) to APPEAR as if it was just one picture taking up a certain amount of space. Right click on the background and hit ‘view background image’ if ya don’t believe me. As for how to insert it, just put it in as if you were using the <img> tag or the <a> tag. Just put in the proper url. bgcolor This is the attribute used to pick the default color for your background to be. There will be more on color later on, so don’t stress over it just yet. It’s a good idea to pick a color even if you’re using an image for you background just in case the image doesn’t load. Try to make it as close to a color of the majority of your image. That way your text color isn’t too close to your background. More on that in the tips page. bgproperties This here is somethin’ special. There’s more to it than this, but like so many things mentioned in this tutorial, it’s on the more advanced level, so we’ll just focus on the one value used above. The value ‘fixed’ locks the background so it does NOT scroll with the text and images put over it. If you do not use this, the background will scroll with it. Some people want it to scroll, some don’t. It all depends on your preference. You don’t HAVE to make it fixed. In that case, just leave out the bgpropertiesr attribute. Simple as that. And that’s pretty much all there is to say about backgrounds when dealing with HTML. Yeah yeah, you could use an animated gif as your background, but it is HIGH RECOMMENDED that you do NOT. Unless you want the people who view your site to go into a SEIZURE from so much motion…then by all means, put in a teeny tiny little animated gif as your background. It will tile it and then there will be motion ALL across the screen. Not only will this slow down your computer but it will KILL your eyes. You won’t be able to read the text and you’ll end up with a nasty headache. I strongly urge you NOT to use animated gifs for your background image!! Oh...and when you’re done coding and you’re at the bottom of your page...CLOSE YOUR TAGS!!! |