Last post Aug 21, 2012 05:02 AM by jprochazka
Aug 21, 2012 03:15 AM|ThunderWaffeMC|LINK
The title says it all. My error:
I have everything in my CSS and it isn't working in the browser. The things in my CSS are background images and margins etc. It works in the VS web developer 'design' layout as shown:
And in the web page it looks like this:
Aug 21, 2012 03:31 AM|jprochazka|LINK
Check your paths in the .css file in the browser source code to make sure it is right once deployed.
Make sure any paths to images in your .css files are relative to the css file in question.
If it is a path issue to your .css file you can try using the following to get the correct path to your application:
<link type="text/css" href='<%= Page.ResolveUrl("~/style/site.css" %>' />
Aug 21, 2012 04:04 AM|ThunderWaffeMC|LINK
They all look fine? Not sure?
Aug 21, 2012 04:26 AM|jprochazka|LINK
Can you access the .css file in your browser using the path displayed in your browsers source?
look for the path in the href in the link for the css file:
<link type="text/css" href="THIS/IS/THE/PATH/TO/CHECK.css" />
Make sure it is a URL not a file:// path or local system path like c:\.
Aug 21, 2012 04:44 AM|ThunderWaffeMC|LINK
I typed C:\Users\Toshiba\My Documents\style.css in my browser and it came up with my css file?
Aug 21, 2012 04:49 AM|jprochazka|LINK
If that is the path to your css file in the browser's source when browsing the page that is a problem.
The path should be relative to the document it is attached to something like:
<link type="text/css" href="../css/style.css" />
Or absolute from the root of the site:
<link type="text/css" href="/css/style.css" />
The path should not be a system path such as C:\Users\Toshiba\My Documents\style.css.
Refer to my earlier post about using paths such as this:
<link type="text/css" href='<%= Page.ResolveUrl("~/css/style.css") %>' />
Aug 21, 2012 04:58 AM|ThunderWaffeMC|LINK
So how can I get the file path into a non C: path to use?
Aug 21, 2012 05:02 AM|jprochazka|LINK
Add the css file to your application.
Assuming you named your css file "style.css" and placed it in a folder called "css" in the root of your application.
<link type="text/css" href="<%= Page.ResolveUrl("~/css/style.css") %>" />