gpt4 book ai didi

gist - 要点—如何设置嵌入式要点的高度和宽度

转载 作者:行者123 更新时间:2023-12-03 12:08:59 28 4
gpt4 key购买 nike

为了将来自Github的很长的Gists嵌入到Wordpress博客中,什么代码将允许我设置高度,以便生成垂直滚动条? 500px左右的东西将是完美的。

编辑:现在已经解决了该问题,但是我花了很多时间在此问题上,我相信专门讨论该问题的线程会有所帮助。我在下面发布了一个有效的答案。

最佳答案

<style type="text/css">
.gist {width:500px !important;}
.gist-file
.gist-data {max-height: 500px;max-width: 500px;}
</style>

<script src="https://gist.github.com/user-name/123456789.js"></script>

示例:从以下网站借来的样板网页: http://www.dummies.com/how-to/content/a-sample-web-page-in-html.html [答案截至2016年2月24日,在OSX Snow Leopard 10.6.8上使用Firefox 44.0.2进行了广告宣传。
<html>
<!-- Text between angle brackets is an HTML tag and is not displayed.
Most tags, such as the HTML and /HTML tags that surround the contents of
a page, come in pairs; some tags, like HR, for a horizontal rule, stand
alone. Comments, such as the text you're reading, are not displayed when
the Web page is shown. The information between the HEAD and /HEAD tags is
not displayed. The information between the BODY and /BODY tags is displayed.-->
<head>
<title>Enter a title, displayed at the top of the window.</title>
</head>
<!-- The information between the BODY and /BODY tags is displayed.-->
<style type="text/css">
.gist {width:300px !important;}
.gist-file
.gist-data {max-height: 300px;max-width: 300px;}
</style>
<body>
<h1>Enter the main heading, usually the same as the title.</h1>
<p>Be <b>bold</b> in stating your key points. Put them in a list: </p>
<ul>
<li>The first item in your list</li>
<li>The second item; <i>italicize</i> key words</li>
</ul>
<p>Improve your image by including an image. </p>
<p><img src="http://www.mygifs.com/CoverImage.gif" alt="A Great HTML Resource"></p>
<p>Add a link to your favorite <a href="http://www.dummies.com/">Web site</a>.
Break up your page with a horizontal rule or two. </p>
<hr>
<p>Finally, link to <a href="page2.html">another page</a> in your own Web site.</p>
<!-- And add a copyright notice.-->
<p>&#169; Wiley Publishing, 2011</p>
<script src="https://gist.github.com/lawlist/12345678.js"></script>
</body>
</html>

关于gist - 要点—如何设置嵌入式要点的高度和宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22950812/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com