Take the 2-minute tour ×

I've been stuck on this for 3 days now. I have two pages that basically share some code for a search feature on my website, here's my code


#btnSearch {
    display: block;
    color: #ffffff;
    width: 100px;
    height: 27px;
    border: 0;
    padding: 0;
    background: transparent url("Images/btnSearch2.png");

When I'd gotten the one page working, I copied that code to the page where it doesn't work, but it hasn't made any difference, here's the HTML (don't worry about the inline css, that's just for convenience while I'm working on it...)

EDIT1: All other classes work correctly as they (along with the css above) come from a stylesheet at <webroot>/App_Themes/Default... The images go in a subdirectory of this location.

I don't see why this code works on 1 page and not the other when all the other CSS classes work on both pages...

share|improve this question
Can you describe the locations of the working page vs locations of not working pages? and the language you are using to create the site in, it may be a c#\asp.net problem more than CSS. –  Mauro Oct 1 '10 at 10:58
add comment

3 Answers

up vote 0 down vote accepted

Maybe it´s a Browser problem: Try to open the file that doesn´t work in another browser.

Maybe you have a tag named the same way #btnSearch in the pages where the styles don´t apply.

share|improve this answer
No change on any other browsers –  Logan Young Oct 1 '10 at 14:04
OK - strange - try to rename the #btnSearch or to give it a .class. Maybe Firebug could help... –  Lukas Oct 1 '10 at 16:37
THIS COMMENT IS CRUCIAL FOR THE ANSWER... @Lukas, I've accepted your answer because your comment about changing it to a class is what helped me fixed it. I added CssClass="bthSearch" to both pages and changed the css from #btnSearch to .btnSearch This has fixed the problem. –  Logan Young Oct 1 '10 at 23:07
add comment

Have you tried the absolute image path and see if it works that way?

share|improve this answer
add comment

Is the path to the background image correct for the page where the code doesn't work? Or even the path to the CSS file?

share|improve this answer
It wouldn't make a difference would it? seeing as the path to the image is declared in the .css file... I've also made sure that the <link href=""> path is right for both pages (hence all other classes working correctly on both) –  Logan Young Oct 1 '10 at 10:09
add comment

Your Answer


