Logan Young
Logan Young

Reputation: 431

CSS background image for asp button control

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

Upvotes: 0

Views: 2761

Answers (3)

enforge
enforge

Reputation: 925

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

Upvotes: 1

Lukas
Lukas

Reputation: 106

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.

Upvotes: 0

Chris
Chris

Reputation: 3795

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?

Upvotes: 0

Related Questions