简体   繁体   English

如何在没有 CodePen 框架的情况下将 CodePen 中的笔嵌入网站

[英]How to embed pens from CodePen into websites without CodePen frame

Is it possible to embed a pen from CodePen into a website without the default frame/navigation bar?是否可以在没有默认框架/导航栏的情况下将 CodePen 中的笔嵌入网站? In other words, is it possible to get rid of the bar across the top and bottom of the pen?换句话说,是否有可能摆脱笔的顶部和底部的横杆? Thanks!谢谢!

You can do it by setting the data attribute on the embedded code snippet like so - 您可以通过在嵌入式代码段中设置data属性来实现此目的,如下所示-

data-show-tab-bar='no'

or in the Embed Theme Builder by choosing 'hide' option in the Tab Bar dropdown. 或在“嵌入主题生成器”中,通过在“标签栏”下拉菜单中选择“隐藏”选项。 However, this is a PRO feature, and will only work if you have PRO version of the codepen. 但是,这是一个PRO功能,只有在您拥有Codepen的PRO版本时,该功能才有效。

If you don't want to pay for the Pro version of Codepen, here's another option:如果您不想为 Codepen 的 Pro 版付费,这里有另一种选择:

  1. Export and download your Codepen project导出和下载您的 Codepen 项目
  2. Upload files to a Github Pages site将文件上传到 Github Pages 站点
  3. Embed the Github Pages project URL in your desired location.将 Github Pages 项目 URL 嵌入到您想要的位置。

 <embed src="username.github.io/project_name">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM