- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这里三笔中有三个文件,我尝试将它们全部链接在一起,但仍然不起作用。我非常感谢您的帮助。
@import "reset";
@import "variables";
@import "mixins";
#main-nav{
background: $deepBlue;
ul{
width: 100%;
}
li{
float: left;
width: (100% / 6);
@include mQ(600px){
width: 100%;
}
}
a{
color: $offWhite;
text-decoration: none;
padding: 16px;
display: block;
text-align: center;
&:hover{
background: lighten($deepBlue, 6);
}
}
@include clearFix;
}
section h1{
margin: 40px 0;
text-align: center;
text-transform: uppercase;
color: $deepBlue;
font-size: $sectionHeading;
}
#services{
li{
float: left;
width: 33.33%;
box-sizing: border-box;
text-align: center;
}
img{
width: 60%;
margin: 20px 20%;
}
a{
text-decoration: none;
color: $deepBlue;
font-weight: bold;
&:hover{
color: complement($deepBlue);
}
}
@include clearFix;
margin-bottom: 60px;
}
.lead-banner{
@include banner;
text-align: right;
}
.lessons-banner{
@include banner;
text-align: left;
li{
text-transform: uppercase;
font-size: 20px;
max-width: 500px;
margin: 60px 0;
}
}
#projects li{
@include grid(6, 2%);
img{
width: 100%;
}
}
这是变量.sccs 文件
$deepBlue: #032f3e;
$sectionHeading: 28px;
$offWhite: #f8f9fb;
$bannerHeading: 46px;
这里是重置.scss文件
body {font-family: arial; background: #f8f9fb}
html, body, ul, ol, li, form, fieldset, legend
{
margin: 0;
padding: 0;
}
h1, h2, h3, h4, h5, h6, p { margin-top: 0; }
fieldset,img { border: 0; }
li { list-style: none; }
.wrapper{
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
box-sizing: border-box;
}
这是编译后的代码
@mixin banner{
width: 100%;
position: relative;
color: white;
.banner-content{
position: absolute;
top: 50px;
width: 100%;
}
img{
width: 100%;
}
span{
font-size: $bannerHeading;
display: block;
text-transform: uppercase;
font-weight: bold;
@include mQ(3000px, 1200px){
font-size: 68px;
}
}
span.sub-title{
font-weight: normal;
margin-bottom: 30px;
}
@include mQ(1200px){
max-height: 640px;
overflow: hidden;
}
}
@mixin clearFix{
&:after{
content: "";
display: block;
clear: both;
}
}
@mixin grid($cols, $mgn){
float: left;
width: ((100% - (($cols - 1) * $mgn)) / $cols );
margin-right: $mgn;
margin-bottom: $mgn;
&:nth-child(#{$cols}n){
margin-right: 0;
}
}
@mixin mQ($args...){
@if length($args) == 1{
@media screen and (max-width: nth($args, 1)){
@content;
}
}
@if length($args) == 2{
@media screen and (max-width: nth($args, 1)) and (min-width: nth($args, 2)){
@content;
}
}
}
这是我的笔的链接
最佳答案
你必须在codepen的设置中导入你的文件,然后codepen导入它
关于css - 如何让我的 sass 登陆页面在 codepen 上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43710827/
是否可以将 CodePen 中的笔嵌入到没有默认框架/导航栏的网站中?换句话说,是否有可能摆脱笔顶部和底部的横条?谢谢! 最佳答案 您可以像这样在嵌入式代码片段上设置数据属性来实现 - data-sh
当我在 IE 10 或 11 的 codepan 中打开它时,这段代码有效,但当我尝试在 jsfiddle 或 IE 10 或 11 的任何地方执行相同操作时,它不起作用。我已经尝试过复制/粘贴和导出
因此,每当您在 Codepen 上创建笔时,它都会为您的笔分配一个屏幕截图,作为缩略图在您的仪表板中代表该笔。 但我面临的问题是,当我更新笔(或更改其外观)时,与笔关联的缩略图也应该更新,但情况并
我将此复选框设计得看起来像一个开关。我想在其中添加“ON”和“OFF”一词。这就是我遇到的麻烦。 这是代码笔:http://codepen.io/anon/pen/BKMErO CSS: .switc
我正在尝试控制台记录一个应该包含数组的变量。但是,在 Codepen 中,它返回一个空数组。我期待它返回列表项的内容。 这是 Codepen连同一些代码片段: 顺便说一句,这是一个 React 项目,
我有这支笔:https://codepen.io/dteiml/full/PNMwZo使用以下 JavaScript 代码: $('#getWeather').on('click', function
我正常使用 codepen,我正在将 imgur 图片链接到 imgur 或 GoogleDrive,它们都可以工作,但一段时间后它们不再出现,这可能是什么?已配置为公开访问。 最佳答案 来自 im
我在 Codepen 上有这段代码: body { width: 100px; height: 100px; background-color: #eee; background-im
我正在尝试用 html 和 css 做我的第一个元素,但遇到了一些麻烦。我正在练习使用 codepen,我的画廊进展顺利,但我正在尝试添加最后一行图像,它似乎把一切都搞砸了,我不知道为什么。有人介意看
我刚刚偶然发现了一个代码笔 demo .然后代码在 codepen 窗口中工作正常。当我将它复制到本地 HTML 文件时,它停止工作了。这是所有组合在一个 .html 文件中的代码 body
我有一个代码字体图标动画 我的问题是当我在本地服务器动画中运行时它不起作用 它只在 http://codepen.io/TimPietrusky/pen/ELuiG 中起作用 甚至尝试过 http:/
我正在尝试将图像和声音文件链接到我的 Code pen link使用下拉框共享链接。
我尝试将 CodePen(来自 codepen.io)添加到我的网页,但它没有按照我想要的方式显示。它只显示文本:'See the Pen ... on CodePen'。 The picture I
我正在尝试在同一个容器中制作 8 张产品卡片,我正在按照以下示例进行操作: https://codepen.io/virgilpana/pen/RNYQwB 但是当我尝试添加第二张、第三张等卡片时,动
尝试在我的笔中使用样式组件 https://codepen.io/mxshrv/pen/aMXvQd , 但出现错误 Cannot use 'in' operator to search for 'd
我正在阅读ReadmoreJS我很高兴能在 CodePen 上尝试一下。然而,当我阅读网站上的说明并在CodePen上实现一些代码时,它根本不起作用。这是我的CodePen的链接查看代码。在 JS 选
这是一个工作的 CodePen,当我将整个代码导出到本地 JS HTML 和 CSS 文件时,它不起作用...... https://codepen.io/pixy-dixy/pen/mYxLpR 我
很抱歉问了这个愚蠢的问题,但我想知道如何使这个 javascript 成为我网站的背景。对于 JavaScript 来说相对较新,我不太确定如何将其实现为背景。 代码笔链接: '''https://c
我只是想将自定义文本放在倒计时圆圈的中心,但我不知道如何替换当前位于中心的数字和文本。 Codepen 链接: http://codepen.io/anon/pen/zqjdRg 示例代码:
我正在使用 jQuery 并使用 JSON 在 Codepen.io 中制作一个简单的项目。 我想从对象数组中选择一个随机索引,为此我使用 getRandomArbritary 函数。 但是,在 co
我是一名优秀的程序员,十分优秀!