How to add CSS to an eclipse HTML file - java

My assignment is to create a class in java and add tags through comments to make it look just like this http://docs.oracle.com/javase/7/docs/api/. My problem is though that the CSS doesn't stay with the html file. It comes out without the CSS. I've tried doing
<style>href="http://docs.oracle.com/javase/7/docs/api/stylesheet.css"</style>
but I can't get the CSS to stick. What am I doing wrong?

This is the way you link css files in html
<link href="http://docs.oracle.com/javase/7/docs/api/stylesheet.css" rel="stylesheet" type="text/css">

Did you add the lines as ususer2812693 mentioned. Just check whether, the css is file loaded into the browser using firebug. And also the css classes and ID s are correct with html elements' classes and ID s. Or else, first try to download the css file which you refer and, try to call it locally from your html page.

Related

Vaadin 14 show simple HTML Page

I made some kind of internal manual for a webapp that i am developing. I am using Spring Boot and Vaadin 14. How to implement a button that shows that document? The html doc is in my resources folder. I wonder if i am stupid. Or should i write my own controller for this?
A Vaadin application itself is a single dynamic HTML page.
The easiest way to include HTML formatted content (not an HTML document) is to use the Html component.
Html html = new Html("<div><h3>Title</h3><p><b>Bold summary text</b></p><p>Other text</p></div>");
layout.add(html);
Note, when you use the Html component, you need to strip the <head> and <body> tags, as Html's purpose is not to show full HTML documents. The Html component's content should be included inside a single root element - usually a <div> is used for this purpose.
However, based on your use case, I think the Html component will serve you well.

How can I Reverse routing and fingerprinting for public assets in non-scala page

The official sample is in scala here , but my project use java and plain html.
So I don't know how to translate this line
<link rel="stylesheet" href="#routes.Assets.versioned("assets/css/app.css")">
to a plain html file.
Shortly: you can't.
You need to put your raw HTML files in the views folder and change their names from foo.html to foo.scala.html, then you can write simple action which will render proper templates by reflection.
You can use them even if they doesn't contain any arguments.
Having a default Play configuration for routes:
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
If your file resides under following directory:
public
assets
css
app.css
You can translate the link to:
<link rel="stylesheet" href="/assets/assets/css/app.css">
Basically public directory is replaced with assets. Rest stays the same.
Keep in mind, if you amend Assets configuration in routes, your links might become dead.

CSS not changing while using Play Framework

I am trying to make changes to my CSS while editing my web app. Any changes I make to the file are not reflected once I reload the page. I know it is linked to the correct CSS sheet as if I remove it from the directory the page loads plain HTML. Is there a way to make changes to the CSS and have them reflected straight away in the application? The CSS I have already written displays fine, it just does not change "live".
<link rel="stylesheet" type="text/css" href='#routes.Assets.at("stylesheets/main.css")'>
Definitely seems like a cache issue. CSS changes will change live when there is no cache system. Try doing a force reload of the page (ctrl+F5 win, Apple + R mac, F5 linux). You may also need to clear the playframework cache (see here for info on how to do that).

where and how to link html file,css file,javascript file and jsp

i have CSS file in one folder,html file in one folder,javascript in one folder. where shoul i link these files and how?whether in html or jsp page.please let me know.. even after giving a link like
where CSS is my folder.
how a proper aggregation is needed in in eclipse considering the industry standards ?
You link the files on your html page in the head of the document.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="../css/main.css">
<script src="../js/main.js"></script>
</head>
...
Some people recommend linking javascript at the end of the document (just before the closing body tag) so that the visible elements can be rendered first before the javascript is parsed.
Just to clarify, css must be in the head; javascript can be anywhere and possibly/probably optimal at the end.
use link element to link various resources to your page like: CSS files, a favorite icon ...
check out this video demo
and script tag (as shown above by Crazysheep) to link scripts

How to apply custom styles to a jasper html report

How does one apply custom CSS to a HTML report generated using Jasper. I need to include this report as an iFrame into a GWT window.
You can simply include a link tag in your GWT html file like so:
<link type="text/css" rel="stylesheet" href="myJasperStyles.css">
The CSS file should explicitly refer to Jasper-related HTML tags to ensure the CSS won't affect your GWT elements.

Categories