How to load css link into the head tag?
See original GitHub issueHello, First of all, thanks for contributing such an amazing js framework. I am very new to grapesjs. And github too.
canvas: {
scripts: ['https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js']
}
https://github.com/artf/grapesjs/wiki/Components-&-JS#template-related According to grapesjs wiki, I load js links inside the canvas as the above codes and it works fine.
But when I try with css links like this, it doesn’t work.
canvas: {
links : ['https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css']
}
Some people here suggest to add those CSS links directly under the id=“gjs”. I did it but what happen is if I clean the canvas, it also clean my css links and CSS doesn’t work anymore. My question is how can I load CSS link into the head tag?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to add CSS
To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property. Example. Inline styles...
Read more >External CSS Stylesheets – How to Link CSS to HTML and ...
The first of the two indispensable attributes is the rel attribute. You will use this attribute to tell the browser what the relationship...
Read more >How to Link CSS to HTML Files in Web Development
In order to link HTML to CSS in your HTML file, you need to use link tags with the right attributes. Remember that,...
Read more >The External Resource Link element - HTML - MDN Web Docs
For example, the stylesheet link type is body-ok, and therefore <link rel="stylesheet"> is permitted in the body. However, this isn't a good ...
Read more >jquery - Load CSS file into head section or into HTML ...
Not sure how HTML compliant this is, but you can include a link within your body tag and still have it reference the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You were almost there 😃
You have to include separately while rendering, it won’t come in getHtml() or anything.