Error in Loading Css codes - css

I moved whole ASP.Net website folder into another location, now when I run it, there is an error in loading css files, I have Master page which loads Css files, and other pages should use it, but when I debug the page with FireBug, there is no rule in .css files which this page used them. why is it happenning??
my website Structure
my Folder/style/main.css
mu folfer/js/jquery-1.10.1.min
in my master page I use this Code
<link rel="Stylesheet" type="text/css" href="style/main.css" />
<script src='<%= ResolveUrl("~/js/jquery-1.10.1.min.js")%>'></script>
in Firebug , there is this message when I click on each Css file in Css Part.
There are no rules. You can create a rule.

Related

file created using pingendo is uploaded on server but its css is not working

i created a html page in pingendo using its drag and drop feature.
3 files were created draft.html, draft.css, draft.less.
I uploaded files on my website on hostinger.
But it only shows the html part and css is not loaded.
what changes should I make in pingendo files to make it work?
Are you linking to the css file sored locally on your machine in your HTML?
IE: <link href="C:\Users\USERNAME\Desktop\web\assets\draft.css" rel="stylesheet" type="text/css">
Rather than directly going to the path of the CSS in relation to your HTML page?
IE <link href="assets\draft.css" rel="stylesheet" type="text/css">
May I have a link to your site to take a look?

Why the same css path is working for asp pages but not for content pages

I have a folder in my web application where aspx page and content page both are there and master page is in root location. I am using the css path which is loading fine in firefox console for aspx page but the same path is not loading for content pages checked in firefox console. Due to that some of the boostrap functionality not working.
Below is the css path for aspx page
<link href="MySheet.css" rel="stylesheet" type="text/css" />
and same path is used for content page
<link href="MySheet.css" rel="stylesheet" type="text/css" />
Need help in this.
The browser resolves the href url in a relative manner. If it's located in the root, you can place "/" in the beginning of the path, like this:
<link href="/MySheet.css" rel="stylesheet" type="text/css" />
this will instruct the browser look for the stylesheet in the root, regardless of the current page's relative path. But if you use a server-side technology, like ASP.NET, there's another way of specifying the application's root - "~/", in this case, though in this case you'd have to add runat="server" to the tag, so it would look like this:
<link href="~/MySheet.css" rel="stylesheet" type="text/css" runat="server" />

Tidying up my ASP.NET project has broken my relative paths

I have just created some directories and tidied up my growing ASP.NET project but it has caused some issues that I can't solve. I have a directory in the root of the project called js and another one called Pages.
In Pages I have a file called MasterPage.master which is a master page. The Pages directory has Default.aspx and some subdirectories of other pages.
I have two main issues. In MasterPage.master I have code like this to reference javascript files:
<script src="js/jquery-ui-1.8.6.custom.min.js" type="text/javascript"></script>
However none of my javascript can be found any more. I tried <script src="/js/jquery-ui-1.8.6.custom.min.js" type="text/javascript"></script> and I tried <script src="~/js/jquery-ui-1.8.6.custom.min.js" type="text/javascript"></script> but it still doesn't work.
The other issue is that I have a menu system written is CSS and that has some strange behaviour. When the page loads the menu works fine. If I navigate to /Pages/Trades/TradeInfo.aspx and then hover over that item the page path now says /Pages/Trades/Trades/TradeInfo.aspx
Why has the Trades directory been added twice?
Have you tried ResolveUrl?
It sure works for the script tags and your anchor tags.
<script src='<%=ResolveUrl("~/Scripts/jquery/ui/jquery-ui-1.8.11.custom.min.js") %>' type="text/javascript"></script>

Insert a single HTML page as an article in Joomla

I have a landing page created as a single html file with an external css file and a bunch of jpeg images. It looks fine and everything is good with it. I need to insert this page as an article in Joomla so that it looked the same way as it does now, without broken styles and missing images. It should show all header, footer and sidebar content from Joomla and the landing page as a regular page. What is the right way to do that?
Create a blank template for joomla and paste the whole body of your landing page to a joomla article.
Alternately, if you are using a totally different stylesheet, you may have better luck if you turn it into a custom template. Joomla's templating model is tremendously simple and abnormally flexible!
Try this
place the css,scripts,images in the root folder of your website.
path could be
/css/style.css or for localhost /joomla/css/style.css
/scripts/script.js or for localhost /joomla/scripts/script.js
/images/image.jpg or for localhost /joomla/images/image.jpg
copy and paste your html code including the file paths in article editor.
this could be
<link href="/css/style.css" rel="stylesheet" type="text/css" media="screen" />//for css
<script type="text/javascript" src="/scripts/scripts.js"></script>//for javascript
<img src="/images/image.jpg" />//for images
use absolute paths for locating your files.
this is irrespective of templates

CSS and images on Master Page

I have this quite popular problem, but have failed to find a solution that works.
Basicly, I am using a Master Page (/Masterpages/Default.master), that includes
<link href="../css/style.css" rel="stylesheet" type="text/css />
And it also includes some images with the same relative linking.
But when I apply the Master Page to content pages (in diffrent folderlevels) the css formating and images is lost.
Is there anyway to dynamicaly solve the folderlevel links to css and images to all content pages using the masterpage?
Thanks in advance
UPDATE:
There is an additional problem. It's tricky to get the output to render correctly in both the browser and in design view in Visual Studio.
I got it to work by using the asp:image solution for the images in the masterpage and by double linking the css in the masterpage, one to make it render in VS and one to make it render correctly browsing the site.
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=ResolveUrl("~/css/style.css")%>" rel="stylesheet" type="text/css" />
best to use:
<link href="<%=ResolveUrl("~/css/style.css") %>" rel="stylesheet" type="text/css />
since this will cope with iis application roots unlike:
<link href="/css/style.css" rel="stylesheet" type="text/css />
You can make your link runat="server" and use tilde mapping to make the CSS path relative to the site root.
<link runat="server" id="siteStyle"
href="~/css/style.css"
rel="stylesheet"
type="text/css" />
The images referenced in the CSS should be relative to the location of the CSS file and should resolve normally once the CSS file itself is included properly. For images in tags on the page, you would need to use the ASP:Image control and, again, use the tilde mapping for a path relative to the root.
Fairly sure this will work
<link href="/css/style.css" rel="stylesheet" type="text/css />
/ takes you to the root of your site
You can use the tilde to get the link to work from anywhere. This will work in Images as well.
<link runat="server" href="~/css/style.css" rel="stylesheet" type="text/css />
Images in CSS are relative to the file they are referenced from.
(An exception from this is the "filter" rule in Internet Explorer which is used for PNG fixes. The images in this case are relative to the HTML document.)
Yes, the problem is that the materpage is using a relative url to load the CSS:
"../css/style.css"
you need to change this to the site root (depending on the location of your css files) something like:
"/css/style.css"
than all the various folder levels can use the same url.
Actually, master pages will rebase css files for you automatically, without you having to add runat="server". Be sure that your css file is located one directory down in the folder you specified.
You can use an absolute path to the css file, but visual studio doesn't seem to render the styles in design view when you do this. Also, sometime you won't know if you're going to be running in a virtual directory, so it's not always ideal to use the absolute path.
Also, use relative links to your image assests from the css file itself - which will work irrespective of how you link to your stylesheet.
You might also be interested in looking into themes and skins.
ASP.NET Themes and Skins Overview

Resources