anaz23 — 2013-11-07T01:41:54-05:00 — #1
I am trying to add a background image for 2 weeks...still i am failing....what i should do to make it right....
ronpat — 2013-11-07T03:54:55-05:00 — #2
Hi, Anaz23, welcome to the forums. Two weeks is a long time; you must be a very patient person.
Do you understand how to read and write HTML?
Do you understand how to read and write any CSS?
Can you post some code that shows us what you are trying to do... how big the image is and where you want it on the page?
If you need some help learning how to post code in a message, please click on the link at the bottom of this post and read the examples.
anaz23 — 2013-11-07T11:52:09-05:00 — #3
i really do have.....ok the picture is in JPEG format and i want to give a background image like <body background="bgJPEG.Image"> oh and the sixe of the picture is 168kb and the size is 960x800 so can you help with that....
And you see i am just started learning how to make a site using html......
ronpat — 2013-11-07T19:37:16-05:00 — #4
This code example shows how to place a background-image on the body tag using CSS.
I wrote the CSS background code in "longhand" so you can see the three components easily:
That same CSS code can be written in "shorthand" on one line like this:
background:url('myBgImage.jpg') no-repeat 50% 0; /* This example shows your background image name */
You can replace everything between the single quote marks with the path/name of your image and it will appear on your page.
Are you using a book to help guide your learning? Learning HTML and CSS is much easier if you use a structured course like a book and work the examples in the book. If you are using bits and pieces from different sites on the internet, you will probably miss a lot of important information about how the different elements act alone and interact with each other, so I recommend taking a structured course or following a book.
You will need to be able to see the suffix of filenames on your computer.
Copy the following code to a file with an .htm or .html suffix and open it in your browser.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
background-image:url('http://placehold.it/960x800/'); /* Replace this image with your image */
anaz23 — 2013-11-12T07:27:51-05:00 — #5
Yes i thing i am missing some important points.......thanks for your help..