Phil5780
asked on
ASP.NET CSS Postback Stripped???
I have an ASP.NET master page that contains a header and footer enclosed in a table. The master page contains a link to my CSS file which my header login link uses for a roll-over button. I've setup CSS as follows:
a.ButtonTest:link
{
background-image: url(../images/SimpleButton Up.gif);
background-color: transparent;
color: White;
cursor: pointer;
width: 80px;
height: 23px;
}
a.ButtonTest:hover
{
background-image: url(../images/SimpleButton Down.gif);
}
This works perfectly upon loading my home page but navigating anywhere else results in the background image being stripped from the CSS. The relative path to the background image is EXACTLY the same as any of the pages I navigate to.
What's going here? How do I make my master page CSS survive posting?
a.ButtonTest:link
{
background-image: url(../images/SimpleButton
background-color: transparent;
color: White;
cursor: pointer;
width: 80px;
height: 23px;
}
a.ButtonTest:hover
{
background-image: url(../images/SimpleButton
}
This works perfectly upon loading my home page but navigating anywhere else results in the background image being stripped from the CSS. The relative path to the background image is EXACTLY the same as any of the pages I navigate to.
What's going here? How do I make my master page CSS survive posting?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try to specify the absolute path
background-image: url(/ParentFolder/images/S impleButto nUp.gif);
background-image: url(/ParentFolder/images/S
hi,
There maybe a problem in where you put your link to the CSS and might be causing you the break. You can check if you have done the same as this:
There maybe a problem in where you put your link to the CSS and might be causing you the break. You can check if you have done the same as this:
<head runat="server">
<style type="text/css" media="all">
@import "styles/styles.css";
</style>
</head>
Can you post your css file markup (How are you adding it to master page?)
e.g in
<head runat="server">
<link href="Styles/myCssSample.c ss" rel="stylesheet" type="text/css" />
</head>
e.g in
<head runat="server">
<link href="Styles/myCssSample.c
</head>
ASKER
You were right, my relative path was wrong. No everything work just fine.
ASKER