Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CSS not being honored
Message
De
09/11/2009 12:03:34
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01433817
Message ID:
01433868
Vues:
27
>>This is currently published as a root level application as it is a test site behind my web site. I originally did not have the first slash on the images and I had added and removed quotes around the url portion to no avail.
>>Also there is some color items that are not applying either. Could it also be the url to the css file is not right within the aspx page because of not being a root level application? I have this:
>>

>>link href="~/CSS/style.css" rel="stylesheet" type="text/css" /
>>>
>
>The tilde shortcut thing only works on server-side controls, not normal HTML markup.
>
>>
>>But it is actually behind the other web app so maybe it should be
>>"/Sandbox/MSA/CSS/style.css"
>
>Yes.
>
>>I am a bit confused now.
>>the root directory of the is web app is set as a virtual (application) directory. Where does this refer to:
>>"/CSS/style.css"
>
>The root of the website.
>
>>or this
>>"CSS/style.css
>
>This is relative to the current page's location. So if the current page is in /Sandbox/MSA then CSS is assumed to be a subdirectory, ex. /Sandbox/MSA/CSS
>
>>or this
>>"~/CSS/style.css"
>
>This isn't resolved for you (take a look in the HTML sent to the browser and you'll still see the ~).

The tilde is likely the reason the external css was not being resolved then. I think I added it because I couldn't get the external images to work. Then after I played with the image url's I never took the tilde back out. Now I have it working in part, so sorting it out. I have to have in the css
/Images/file.jpg as my url value when in development but before I publish I have to change them all to:
/Sandbox/MSA/Images/file.jpg. What a pain, but it works.

Then in the aspx files it just needs to be CSS/style.css without the slash.
Thanks Paul. By the way, how did you get to see the error you saw? I only just saw the page without the images.
Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform