Welcome to WeightLossChat.org!   

Advertisments:




How to add a background image to an html document? help?

How to add a background image to an html document? help?

Postby seadon » Sun Oct 16, 2011 3:47 am

If I wanted to add a tiled background image to an html document, what code would I use?
Everywhere I looked on google they used { and } instead of < and > so I'm not sure if {asdasdasd} is the content of what's inside the < and > or if that's actually used?
So I have the base:
<html>
<head>
<title></title>
<embed src="asd.mp3">
<noembed>
<bgsound src="asd.mp3">
</noembed>
</head>
<body background: white url(asd.jpg) repeat>
</body>
</html>

What would the issue in the code be, and what is the correct code to use?
For the record, the music is working no problem, and the file names are asd.mp3 and asd.jpg, and everything is in the same folder. There's no issue with not finding the image, the issue is with not showing the image.
Thanks!
seadon
 
Posts: 715
Joined: Tue Oct 04, 2011 2:13 pm

How to add a background image to an html document? help?

Postby hoireabard » Sun Oct 16, 2011 3:52 am

Try closing the body tag and making a separate tag for background. If that doesn't work, try making an embedded style sheet in the header, which will also clean up your coding quite a bit.
hoireabard
 
Posts: 666
Joined: Tue Oct 04, 2011 7:27 pm

How to add a background image to an html document? help?

Postby burchard » Sun Oct 16, 2011 3:59 am

For background image use this...

<html>
<head>
<title>Your Title</title>

<style type="text/css">
body{background:url(your_file_name.jpg… repeat top left;
}
</style>
<embed src="asd.mp3">
<noembed>
<bgsound src="asd.mp3">
</noembed>
</head>
<body>
Body

</body>
</html>
burchard
 
Posts: 732
Joined: Tue Oct 04, 2011 5:20 pm

How to add a background image to an html document? help?

Postby chakshu7 » Sun Oct 16, 2011 4:10 am

modify : <body background: white url(asd.jpg) repeat> with
<body background="asd.jpg">
or
<body style="background-image:white url('asd.jpg') repeat">

note : first is pure HTML, second is HTML+CSS. I suggest you to learn HTML and CSS, you can refer to www.w3schools.com
chakshu7
 
Posts: 726
Joined: Tue Oct 04, 2011 2:28 pm


Return to Body Image and Self Esteem

cron