gpt4 book ai didi

css - 如何让我的 sass 登陆页面在 codepen 上运行?

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

这里三笔中有三个文件,我尝试将它们全部链接在一起,但仍然不起作用。我非常感谢您的帮助。

@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;
}
}
}

这是我的笔的链接

https://codepen.io/nezmustafa123/pen/OpEBov

最佳答案

你必须在codepen的设置中导入你的文件,然后codepen导入它

关于css - 如何让我的 sass 登陆页面在 codepen 上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43710827/

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