Please provide the Best and Fastest way to edit the CSS in JSP pages. I am presently trying to use brackets software but getting issue.
Thank you for your support in advance.
Regards,
Lakshman E
My personal preferences are not to mix different technologies.
Each should be stored in its own file(s): css, js
Then use
<link rel="stylesheet" href="stylesheet.css">
<script src="myscripts.js"></script>
to include them in jsp/html.
Related
The idea is to get a configuration JSON from the server after login. And depending on the config(let say a company the user is linked to) use one of the pre-set styles. The frontend is React-based. So, I'll not be able to get the main styles tag by id and change it on the fly:
<link type="text/css" rel="stylesheet" media="all" href="../green.css" id="theme_css" />
document.getElementById('theme_css').href = '../red.css';
Are there any other common ways to load files dynamicly in React(Redux) web-app?
You can try this way. It works great for even larger projects of your browser support is slightly higher or you can implement the same with the help of SASS/LESS.
https://medium.com/#harishv6665_49536/theming-with-react-js-or-any-in-minutes-with-css-variables-11d4ebecdb41
After a deep search, there is something to be known by me which puts me to think a lot and couldn't get the idea of the purpose that it serves. Which is capitalizing the S in stylesheet for rel attribute value.
what is the difference between,
<link rel="stylesheet" href="/css/widgets/some.css">
and
<link rel="Stylesheet" href="/css/widgets/some.css">
what purpose does it serves? An on-shore 15years experienced web application head is insisting to do this. Please explain and make me understand.
There is no difference, as link types are case insensitive. I am guessing that your colleague prefers them that way for some reason.
Please, explain what does "?v=1" mean in <link rel="stylesheet" href="css/style.css?v=1">?
Thank you!
It's an informal way of versioning external resources, and of controlling whether they are cached. You increment that number when the file changes, guaranteeing that all browsers load the new version. The number isn't actually used anywhere - it's just a way of uniquifying the URL for the current version of the file.
I'm hosting a (very) small website on dropbox. I don't even have a domain name for it, I just need an easy way for my not so technology savvy teacher to access it and using an online service like wordpress or tumblr seemed like too much trouble and not as effective as I would like. I plan on putting it in my public folder and just sending her that link, something I've done in the past to show my friends websites I've made in class.
However, for some reason, CSS formatting isn't working. This is a problem I've noticed in the past but at the time wasn't important. I have it relatively linked in my head tag and it works when I pull up the files saved on my hard drive. Its only when I try to access it through dropbox do I notice this problem.
I've looked and it doesn't seem like anyone else has had this problem, I've only found multiple references to dropbox supporting CSS so I have no idea why this is happening.
This is the link in my code, and it's inside the head tag:
<link rel="stylesheet" type="text/css" href="css/format.css" />
Any help would be much appreciated. ^^
EDIT: Here's the page, there's not much on it yet but there's suppossed to be background formatting behind the navigation links in the top.
https://dl-web.dropbox.com/get/Public/EPortfolio/WritingAndForum.html?w=947f0aa1
To give an example expanding on Cfreak's comment, you would need to individually share the CSS file, then reference it in the HTML like this:
<link rel="stylesheet" type="text/css" href="https://dl.dropbox.com/u/1234567/cssfile.css">
A much easier way (and more correct) is to put your stylesheet in a folder called css and then have a relative link to it with "./" It gets you out of the long url trouble.
<link rel="stylesheet" type="text/css" href="./css/styles.css">
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
The above code shows an external css inclusion tag declared in Site.Master template.
My question: why did the Asp.net MVC team choose that way rather than using "~/Content/Site.css" ?
Is it the best practice? I am sorry, I am a newbie and still learning to improve my skill.
EDIT 1: I want to make it clearer that "~/" must be passed in to url-resolving method first. Thus, I can rewrite my question as follows:
Why did the team choose "../.." rather than "~/" resolved by url resolver?
Refer to what #Pauli Østerø said. But, since you asked for a best practice, here it is .. get rid of those hardcoded strings. Use T4MVC for those paths
~ is a asp.net thing and doesn't make sense in pure html. In webforms that is handled by turning the tag into a server control, that can translate ~ into a absolute path, while you in MVC would have to call some method yourself. Some method being Server.MapPath for instance
Or use "/Content/Site.css", as "/" denotes the site root in html.
This issue has been fixed by MVC 3 as follows: I think the MVC team has read this question :-)
<head>
<title>#ViewBag.Title</title>
<link href="#Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="#Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
</head>