twitter-bootstrap JSFiddle 中的外部资源(添加 Twitter Bootstrap CDN)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17478396/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
External resources in JSFiddle (Adding Twitter Bootstrap CDN)
提问by Seong Lee
I am trying to replicate my issue with JSFiddlebut when needed frameworks not supported natively, I believe I will need to import them from external resources. However, clicking +won't open up anything and I am not sure what to do with the URI field.
我正在尝试使用JSFiddle复制我的问题,但是当本地不支持所需的框架时,我相信我需要从外部资源导入它们。但是,单击+不会打开任何东西,我不确定如何处理 URI 字段。
The simple question is, I particularly need to embed Bootstrap.
简单的问题是,我特别需要嵌入 Bootstrap。
How do I embed Bootstrap in JSFiddle?
如何在 JSFiddle 中嵌入 Bootstrap?
回答by nickhar
BootstrapCDN is supported by JSFiddle, you just need to paste in the relevant URLs.
JSFiddle 支持 BootstrapCDN,你只需要粘贴相关的 URL。
In the external resource field/box enter each of these URLs* and hit +:
在外部资源字段/框中输入每个 URL* 并点击+:
http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css
http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js
The result of which is: http://jsfiddle.net/v9ec3/1/
结果是:http: //jsfiddle.net/v9ec3/1/
Which then allows you to post your HTML/CSS/JS as required. Edit away and click updatewhen finished to give you a URL that you can paste anywhere (including here!). Note you don't need to reference it via link.
然后允许您根据需要发布您的 HTML/CSS/JS。编辑update完成并在完成后单击为您提供一个 URL,您可以将其粘贴到任何地方(包括此处!)。请注意,您不需要通过链接引用它。
****Note:** The above bootstrap version URLs (2.3.2) are pasted from http://www.bootstrapcdn.comat the time of the question*
****注:** 以上bootstrap版本网址(2.3.2)是在提问时从http://www.bootstrapcdn.com粘贴过来的*
回答by Bharath Koppula
Use Https instead of http as it jsfiddle allows only https. Please check it down here
使用 Https 而不是 http,因为它 jsfiddle 只允许 https。请在这里检查
https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.csshttps://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js
https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min .js
回答by chiborg
For a more general solution to this (not only Bootstrap but many other JavaScript libraries), I found cdnjsvery helpful: Go to cdnjs, search for your library, copy the URl and paste it in the "External Resources" field of your fiddle.
对于更通用的解决方案(不仅是 Bootstrap,还有许多其他 JavaScript 库),我发现cdnjs非常有用:转到 cdnjs,搜索您的库,复制 URl 并将其粘贴到您的小提琴的“外部资源”字段中。
回答by sanderson
I do something like this: @import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
我做这样的事情: @import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');

