How to load correctly my css asp.net Visual Basic - css

Yesterday I was working on my college project, everything was running smooth so I decided to upload it to github where my partner could access it. Today I opened the local repo and suddenly my CSS wasn't displaying correctly. I'm using Bootstrap 4.
This is how it looks now:
This is how it should look:
I've been using a Bootstrap template. I already tried making a new CSS file but it doesn't change. Also using this post ASP.Net website - doesn't load css file correctly
How I was calling my css
<link rel="stylesheet" href="css/style.css">
I tried
<link rel="stylesheet" href="~/css/style.css">
Even
<head runat="server">
<link rel="stylesheet" href="~/css/style.css" runat="server">
</head>
Css folder is located in asp default folder

Well, after a little attempt, it looks like the project had been corrupted when it was loaded. Since I had finished it on time, I created a new project and include the previous files.
It works like a charm.

Related

Can't access Bootstrap locally

I have been trying very hard to find the right path to my local Bootstrap 5 files, but what ever I do it's not finding it. At the moment I am in index.html (react). There I'm doing this:
<link rel="stylesheet" href="./css/bootstrap.min.css" />
<script src="./js/bootstrap.min.js"></script>
and yes Bootstrap files are inside the css and js folder. What am I doing wrong?
It seems it is working at localhost:3000 but not in localhost:5001 (this one is with server/backend). What is the reason?

GitHub Page loading Bootstrap CSS, but not my custom stylesheet?

I am trying to host my website for free using GitHub (and I'm new to GitHub so sorry if this is a dumb question), but it just is not using the stylesheet I created and uploaded with all my files. It also is not loading images from my images folder. So from what I can tell, it doesn't like using local files, but it is fine using linked stylesheets like Bootstrap and images linked from somewhere online.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="_css/bootstrapOverride.css">
<link rel="stylesheet" type="text/css" href="_css/animate.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
It refuses to use my bootstrapOverride.css and the animate.css.
How can I make it use local files like these? Same question with images as well?
I figured out the problem. The issue was my folder names in linking to my stylesheets. GitHub pages uses Jekyll and Jekyll ignores anything after an underscore. Since the folder I had my CSS in was "_css" it would see the underscore and stop there. I took the underscores out of the folder names, updated my links to the CSS and now we are all good!

Using a CSS in ScrewTurn Wiki

We use ScrewTurn Wiki and I created a Wiki page that contains the CSS information. I used:
<head>
<link rel="stylesheet" type="text/css" href="http://wiki.ourcompany.net/tech.CSS-Master.ashx">
</head>
as the link in all the other Wiki pages as the reference for the CSS info, where Tech is the namespace and CSS-Master is the Wiki page containing the CSS info.
This worked fine for a while, then suddenly it just stopped working. Any suggestions?
Are you trying to apply this CSS across your whole wiki? There's actually a lot you can do with theming. In the main directory on your webserver, there's a 'Themes' subdirectory, where you can make a new folder for a theme, then you can select a theme in the Administration->Configuration page, as well as when you're editing a namespace (if you want to change the theme for a particular namespace).

Angular css files not loading when controlling two Partials with a single Controller

I'm working on a web-application built upon the MEAN stack.
I use bootstrap as css lib, and have some css override in two files of mine "app.css" and "mio.css"
the app works just fine until I hit refresh in a controller that handles two partials, than everything gets reloaded except for my 2 css files.
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="css/mio.css">
If I inspect them they contain the index.html data (head body dcc)
could you suggest what's happening??
Try using full file paths to the css files. For example..
<link rel="stylesheet" href="/assets/css/app.css">
The issue might be on the server side. Since angular apps are single page ajax applications, the server has to redirect all requests to the index.html page EXCEPT for assets. Your server might be returning the index.html page instead of your css files.

In eclipse dynamic web project, how to link css to jsp file in webcontent folder

In Eclipse, I created a Dynamic Web Project and a JSP file under WebContent folder. I also created a CSS file under the WebContent folder. Then I use <link rel="stylesheet" type="text/css" href="XXX.css"> in the JSP to link to the CSS file but when I run on web server (Tomcat) the CSS didn't apply. Can someone tell me why?
You must put your web project name before the address path of your css file
Example:
<link rel="stylesheet" href="/YourProjectName/XXX.css" type="text/css">
or in more dynamic way:
<link rel="stylesheet" href="${pageContext.request.contextPath}/XXX.css" />
Have fun :)
You can use: With style.css file in WEB-INF/jsp folder
<style type="text/css">
<%#include file="css/style.css" %>
</style>
NOTE
This however copies the entire source of the CSS file into the HTML
output of the JSP page. In other words, this is a server-side include,
not a client-side resource reference. So you effectively miss the
advantage that the browser can cache static resources and this way you
end up with a bandwidth waste because the very same CSS file is
embedded in every single page. In other words, a bad idea in terms of
performance and efficiency.
as #BalusC described in comment! you want to test your style.css file anyway, this is a solution.
you can use
<link rel="stylesheet" type="text/css" href="path/css">
You should restart eclipse so that it maps all css and javascript files again.
I worked for me.

Resources