Solved

How can I do this properly with CSS? Body tag.

Posted on 2011-03-03
7
352 Views
Last Modified: 2012-05-11
I have some old code on my site, and I want to replace it with proper CSS. But I've been laying with this and I'm getting a bad result. This works in the browsers I have, but is incorrect:

<body style="leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"" background="images/bg_l-r-body.gif" onload="MM_preloadImages('images/cart-2.png')" >

I have tried this:
CSS file:
{body: margin-left:0px; margin-top: 0px; background: url ("images/bg_l-r-body.gif");
}

then in the html document,
<body onload="MM_preloadImages('images/cart-2.png')" >

But I lose the background  image then.
0
Comment
Question by:mel200
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 35030062
Your syntax is pretty poor.
--- try this
<body style="leftmargin: 0; topmargin:0; marginwidth: 0; marginheight:0;" background="images/bg_l-r-body.gif" onload="MM_preloadImages('images/cart-2.png')" >

Open in new window


I have tried this:
--- this is okay, what isn't it doing for you? Not knowing the image does it need to repeat? If so specify that.
CSS file:
{body: margin-left:0px; 
  margin-top: 0px; 
  background: url ("images/bg_l-r-body.gif");
}

Open in new window



then in the html document,
--- Do you have the javascript function for MM_preloadImages in your CSS somewhere?
<body onload="MM_preloadImages('images/cart-2.png')" >

Open in new window

0
 
LVL 12

Accepted Solution

by:
Chad Haney earned 500 total points
ID: 35031155
Your css syntax is off, the element/class/id goes before the braces
body{
 margin-left:0px;
 margin-top: 0px;
 background: url ("images/bg_l-r-body.gif");
}

Open in new window

0
 

Author Comment

by:mel200
ID: 35031793
AHHHH! Of course!!
0
Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

 

Author Comment

by:mel200
ID: 35031901
Ok, I did this- in the html document, I only have
<head>head tags</head>
 <body> then the html
</body>

In the CSS file I have:
body{
 margin-left:0px;
 margin-top: 0px;
 background: url ("/images/bg_l-r-body.gif");
}

(On my test site I actually took everything else out of the css file and uploaded it).

But I am still missing the image bg_l-r-body.gif.

0
 

Author Comment

by:mel200
ID: 35032002
You can see it on my test site:

http://test dot magic kitchen  dot com slash how-to-start dot html

please use: userid:        visitor password:  mobi;39mobi
0
 
LVL 12

Assisted Solution

by:Chad Haney
Chad Haney earned 500 total points
ID: 35032334
take out the space between url and (  ..........   url("/images/bg_l-r-body.gif");
0
 

Author Closing Comment

by:mel200
ID: 35032584
There you go!  I needed a refresher on the basics, thanks!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question