Click to See Complete Forum and Search --> : How to put image onto background-not working


eddietheeagle
08-14-2008, 11:57 AM
I think I am just not understanding when to use divs and spans and classes, here is the css-I am trying to make the background of the div with the search input and text "search" have the same background as the lis-easy if I make it a li but obviously not what I want. I made it into a div instead. What is the problem here? thanks

.SEARCH {
padding-right: 0px; padding-left: 4px; background:

url(images/nav/tableftl.gif) no-repeat left top; float: left;

padding-bottom: 0px; margin: 0px; padding-top: 0px; text-decoration: none
}

this is the xhtml-why is the image not showing in the background on the search div?:
<div id="tabsH">
<ul>
<li><a title="" href=""><span>home</span></a> </li>
<li><a title="" href=""><span>contact us</span></a></li>
<li><a title="" href=""><span>sitemap</span></a> </li>
<li><a title="" href=""><span>donate</span></a> </li></ul>
<div class="search">Search:<input type="text" /><input type="submit"
value="go"></div>



The link to see the page in action:http://tinyurl.com/5w4b2g

gil davis
08-14-2008, 12:34 PM
I think I am just not understanding when to use divs and spans and classes
A DIV is used for a block of text (think "division") and if not otherwise styled will cause a line break.

A SPAN allows you to affect some text inline without causing a line break.

A CLASS allows you to use a style definition repeatedly throughout the document, even for different elements.
What is the problem here? CaPiTaLiZaTiOn. "SEARCH" is the class, not "search".

coothead
08-14-2008, 12:38 PM
Hi there eddietheeagle,

the problem is...

.SEARCH {

...which is, obviously, uppercase, whereas...

<div class="search">

...is, without doubt, lowercase. ;)

coothead

eddietheeagle
08-14-2008, 02:42 PM
thank you I didn't realize that lowercpas made a difference!

coothead
08-14-2008, 03:43 PM
...I didn't realize that lowercase made a difference
You've probably spend too much time out on the piste. :)

coothead