Please help: background image won't...

User 2073490 Photo


Registered User
154 posts

Still new here. I have created a background image, and posted the rule into css (or so I think!)
It will not display and I wonder of someone might help me find my error?

here is my html code located in my index page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)" />
<meta name="created" content="Wed, 09 Jun 2010 00:32:55 GMT" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link type="text/css" rel="stylesheet" href="mycssname.css"/>
</head>
<body>

</body>
</html>

Here is the top portion of my new stylesheet:

<head>
<title></title>

<style type="text/css">
body {
background:url(backgroundformf.jpg);
text-align: center;
}

p {
background: #FF0000;
}

h1 {
background: #0000A0;
color: #FFFFFF;
font-weight: bold;
font-size: 18pt;
font-family: Arial;


I know this has to just be something really stupid, and I am going cross-eyed looking at it now.
Many thanks!
User 364143 Photo


Guest
5,410 posts

Style sheets do not contain html tags. So remove the html tags <> from the CSS.
<head>
<title></title>
<style type="text/css">

Then link the style sheet to the html with a tag in the html head section.
<link rel="stylesheet" type="text/css" href="myStylesheet.css" />

The code for the background image is
background-image:url('backgroundformf.jpg');
CoffeeCup... Yeah, they are the best!
User 2073490 Photo


Registered User
154 posts

Why thank you, Joker! Funny.... I got that code from the editor! I'm really glad there are smart guys like you to help me out.

By the way, has anyone told you how incredibly scary your profile pic is? It gives me the chills! Whooo, hooo, hooooo!

Have a fabulous Wednesday!;)
User 364143 Photo


Guest
5,410 posts

I'm glad it's working for you, now. :) Yes, I have been told my avatar is scary. Have fun with your new site.
CoffeeCup... Yeah, they are the best!
User 562592 Photo


Registered User
2,038 posts

I would like to also point out that in Joker's CSS, he changed your "background" to "background-image". I want to make sure you picked up on that or you will find your background will not show up in IE.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 2073490 Photo


Registered User
154 posts

I did! Thanks, Spider Man!:lol:
User 562592 Photo


Registered User
2,038 posts

No problem meatloaf! :lol:

Wait, that is meatloaf, isn't it?
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 563328 Photo


Registered User
85 posts

Please excuse this post, but is that Spiderman doing the Evolution of Dance? It cracks me up:lol:

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.