我无法预览我的一个代码笔以在网页上正确显示。本质上,我是在支持 Markdown 的文本编辑器中写一篇文章。发布代码笔所需要做的就是粘贴链接。但是,当我这样做时,预览看起来不对。这是说明问题的两张图片(第一张是错误的,而第二张是正确的):
如您所见,预览版似乎没有transform
正确应用 my 和 margin 样式。这是我的代码:
/* General/reset styles */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Roboto', sans-serif;
overflow-x: hidden;
color: #333;
}
.new-section {
padding-top: 50px;
text-align: center;
font-size: 4em;
font-weight: 100;
}
/* Header styles */
header {
position: relative;
text-align: center;
height: 100vh;
background: linear-gradient(to right, #69bcf4, #30cc8b);
color: #fff;
}
header h1 {
padding-top: calc(50vh - 113px);
font-size: 7em;
font-weight: 100;
}
header h2 {
font-size: 2em;
}
header span.animated {
position: absolute;
margin: auto;
right: 0;
left: 0;
bottom: 50px;
height: 4px;
width: 4px;
border-radius: 2px;
background: #fff;
animation-duration: 2.5s;
animation-iteration-count: infinite;
}
header span::before,
header span::after {
position: absolute;
top: -23px;
content: "";
height: 30px;
width: 4px;
border-radius: 2px;
background: #fff;
}
header span::before {
left: -10px;
transform: rotate(-45deg);
}
header span::after {
right: -10px;
transform: rotate(45deg);
}
/* Media queries */
@media (max-width: 759px) {
header h1 {
font-size: 5em;
}
.new-section {
font-size: 3em;
}
.scroll-animations {
display: block;
}
.scroll-animations div {
padding: 20px 80px;
}
.click-animations input,
.click-animations textarea,
.click-animations button {
width: 80%;
}
}
@media (max-width: 475px) {
.new-section {
font-size: 2.5em;
}
header h1 {
font-size: 3.2em;
}
header h2,
.funky-animations h3 {
font-size: 1.5em;
}
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css" rel="stylesheet"/>
<header>
<h1 class="animated bounceInDown">Animate.css</h1>
<h2 class="animated bounceInDown">Level Up Your Websites with Animate.css</h2>
<span class="animated bounce"></span>
</header>
如果有帮助,您可以在此处查看实际的笔。有什么想法或我想念的东西吗?谢谢!