tags:

views:

30

answers:

3

Hi!

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

The CSS

#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...

A: 

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?

lofto
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
A: 

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.

Lukas
No change on any other browsers
Logan Young
OK - strange - try to rename the #btnSearch or to give it a .class. Maybe Firebug could help...
Lukas
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
+1  A: 

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

enforge