10 replies [Last post]
btr
btr's picture
User offline. Last seen 2 years 16 weeks ago. Offline
newbie
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
User offline. Last seen 14 weeks 6 days ago. Offline
rank Guru
Guru
Timezone: GMT-5
Joined: 2009-10-09
Posts: 2037
Points: 2256

You should validate your CSS.

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

yet again.

Deuce
Deuce's picture
User offline. Last seen 3 weeks 6 days ago. Offline
rank Guru
Guru
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4421
Points: 1840

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
User offline. Last seen 3 weeks 6 days ago. Offline
rank Guru
Guru
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4421
Points: 1840

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
User offline. Last seen 16 weeks 1 day ago. Offline
rank Guru
Guru
Timezone: GMT-6
Joined: 2008-08-15
Posts: 2634
Points: 1552

btr, did you place the href's

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


First basic few steps in building a webpage
1. Gather and collect content.
2. Organize the content into meaningful semantic valid HTML
3. Design the prototype
4. Style using CSS

http://www.pixelbehavior.com

Verschwindende
Verschwindende's picture
User offline. Last seen 14 weeks 6 days ago. Offline
rank Guru
Guru
Timezone: GMT-5
Joined: 2009-10-09
Posts: 2037
Points: 2256

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?

yet again.

btr
btr's picture
User offline. Last seen 2 years 16 weeks ago. Offline
newbie
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
User offline. Last seen 3 weeks 6 days ago. Offline
rank Guru
Guru
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4421
Points: 1840

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
btr's picture
User offline. Last seen 2 years 16 weeks ago. Offline
newbie
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
btr's picture
User offline. Last seen 2 years 16 weeks ago. Offline
newbie
Timezone: GMT-6
Joined: 2010-01-20
Posts: 4
Points: 7

Resolved!!!

Thank You! Thank You! Thank You!

Resolved!!!

CupidsToejam
CupidsToejam's picture
User offline. Last seen 16 weeks 1 day ago. Offline
rank Guru
Guru
Timezone: GMT-6
Joined: 2008-08-15
Posts: 2634
Points: 1552

can you provide a live

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


First basic few steps in building a webpage
1. Gather and collect content.
2. Organize the content into meaningful semantic valid HTML
3. Design the prototype
4. Style using CSS

http://www.pixelbehavior.com