How do I put an image I have downloaded from the net onto my back ground. I know the code (from w3 schools) but I don't know how to save it correctly and then how to put in the URL so the computer can find it. Do I need to save any image I use as a jpeg? If I put it into my documents how do I correctly address it when entering the code.
Tags: Technology Internet, background image, back ground, Uniform Resource Locator, w3 schools, markup languageHow to Add a Background Image to a Table Created in Xhtml?
Previous post: How to Load Xml File Using Radio Button?
{ 4 comments… read them below or add one }
If you are making a web page, put all the files you use into a common folder that is to be used as your "root directory". If you plan to have lots of images, make a sub-folder called "images" to put all your images in there. When saving from the web, just be sure to save all images to that folder. You will be allowed to browse to it once the save window pops up. Rename file before you save if you wish.
If you plan on NOT publishing the web page anywhere and you do NOT want to make a "root" folder for your files, then the paths to your images will be very long indeed. Example:
file:///C:/My%20Folder/_A%5D%20My%20Web%20Stuff/Yahoo%20Answers/search.gif
Whatever the path with files outside of where your HTML page is, be sure this is used: "file:///C:/"
You can use inline CSS if you do not know how to use external or embedded CSS. For your table tag and background image:
style="width: XXpx; height: YYpx; margin: 0 auto; background: url(path to bg image) no-repeat center scroll;"
Be sure width and height is enough to show complete image if it is NOT to be tiled.
Ron
dunno plz tumbs up
You need to target the image using CSS as such:
td { background-image: url(type the location to the picture you downloaded here); }
http://www.w3schools.com/css/pr_background-image.asp
Rather than using the body { data: data; } in the example, use the td tag.
I’m not exactly sure of your purpose, but CSS usually works fine. Just create a CSS class, such as;
<style type="text/css">
table.bgimage {
background-image: url("path/to/image.png");
}
</style>
and in your code, where you would have the <table> tag, just add the class to it, such as;
<table class="bgimage"> … </table>
Hope this is helpful!
You must log in to post a comment.