10 replies [Last post]
btr
Offline
newbie
Last seen: 12 years 16 weeks ago
Timezone: GMT-6
Joined: 2010-01-20
Posts: 4
Points: 7

I'm spinning my wheels. When I add the doctype, any doctype, my background images disappear. If I remove the doctype, my background images re-appear. I have to have the doctype for other css to work properly.

I can't figure out how to make this work.

Following is the stripped down version of my code!!!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Test Html Webpage</title>
 
 
<style type="text/css" media="screen">
 
#Cart{
width: 100px;
height: 31px;
background-image:url(<a href="http://shop.2farm.com/IMAGES/siteimages/cart-wide.gif" rel="nofollow">http://shop.2farm.com/IMAGES/siteimages/cart-wide.gif</a>);
}
 
#Cart a{
font: 9px Verdana;
padding: 2px;
padding-left: 4px;
display: block;
width: 100%;
color: blue;
text-decoration: none;
text-align: right;
}
 
html>body #Cart a{ /*Non IE rule*/
width: auto;
}
 
#Cart a:hover{
width: 100px;
height: 31px;
font: bold italic 9px Verdana;
background-image:url(<a href="http://shop.2farm.com/IMAGES/siteimages/cart-wide.gif" rel="nofollow">http://shop.2farm.com/IMAGES/siteimages/cart-wide.gif</a>);
}
 
 
</style>
 
</head>
 
<body>
 
 
<table width="768" align="center" bgcolor="#ffffff" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="right" height="99">
    <table width="100%" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="TOP" align="right" nowrap="nowrap">
          <div id="cart">
            <a href="#">
              0&nbsp;Items&nbsp;<br>Check Out&nbsp;</a>
          </div>
        </td>
      </tr>
      <tr height="20"><td>&nbsp;</td></tr>
      <tr height="20"><td>&nbsp;</td></tr>
      <tr height="20"><td>&nbsp;</td></tr>
      <tr height="20"><td>&nbsp;</td></tr>
    </table>
  </td>
  </tr>
</table>
<!--99-->
 
</body></html>

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 18 weeks 2 days ago
Timezone: GMT-5
Joined: 2009-10-09
Posts: 2050
Points: 2282

You should validate your CSS.

You should validate your CSS. Invalid values in the URLs.

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 4 years 43 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

Verschwindende wrote: You

Verschwindende wrote:

You should validate your CSS. Invalid values in the URLs.

Unless this one is different, I think it's something that the board has been doing lately.

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 4 years 43 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

However, for a

However, for a solution.

#Cart != id="cart"

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 6 years 35 weeks ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2637
Points: 1556

btr, did you place the href's

btr, did you place the href's in the css? If, so thats your problem.

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 18 weeks 2 days ago
Timezone: GMT-5
Joined: 2009-10-09
Posts: 2050
Points: 2282

Deuce wrote: Verschwindende

Deuce wrote:
Verschwindende wrote:

You should validate your CSS. Invalid values in the URLs.

Unless this one is different, I think it's something that the board has been doing lately.

I thought it happened if you copied code from here into your css but not if you copy your css into here. Wait, did that make sense?

btr
Offline
newbie
Last seen: 12 years 16 weeks ago
Timezone: GMT-6
Joined: 2010-01-20
Posts: 4
Points: 7

CSS solution

I tried this code at the beginning of the css and the end of the css without any change to the web page!!! I must be missing something!!!

Please Help!

Thanks!!!

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 4 years 43 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

Sorry, guess I should

Sorry, guess I should explain.

Your CSS is calling #Cart <--- Note the CAPITAL 'c'
Your HTML is using id="cart" <--- Note the LOWERCASE 'c'

An uppercase 'c' does not equal a lower case 'c'.

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

btr
Offline
newbie
Last seen: 12 years 16 weeks ago
Timezone: GMT-6
Joined: 2010-01-20
Posts: 4
Points: 7

solution still needed

The hrefs are not in the css. above was put in by this forum post because I had a url entered. I tried the "#cart != id="cart" with no change. I do appreciate all this help; but, I am still baffled!

btr
Offline
newbie
Last seen: 12 years 16 weeks ago
Timezone: GMT-6
Joined: 2010-01-20
Posts: 4
Points: 7

Resolved!!!

Thank You! Thank You! Thank You!

Resolved!!!

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 6 years 35 weeks ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2637
Points: 1556

can you provide a live

can you provide a live example of the problem? a link?