两个问题,老师解答一下
来源:4-1 sass案例(1)
Sunflower加油
2019-12-25 18:31:13
第一个:跟着老师一起写的,我的logo怎么那么大。

第二个问题:老师那个reset.scss我的vscode一直报一个错误


2回答
好帮手慕糖
2019-12-25
同学你好,关于你的问题,回答如下:
1、如下,宽度应该设置为100px,不是宽度100%,例:

2、同学是哪一步出现的这个报错?老师这里没有这一步报错的,建议:可以查看下是否是文件夹名称中有中文导致的。
祝学习愉快~
Sunflower加油
提问者
2019-12-25
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>今日头条</title> <link rel="stylesheet" href="index.css"> </head> <body> <div class="header"> <div class="title_logo"></div> </div> </body> </html>
-----------------------------------------------------------------
@import './reset.scss';
$baseFontSize:17px;
$redColor:#d43d3d;
$assetsDir:'assets';
.header{
height: 45px;
background-color: $redColor;
.title_logo{
width: 100%;
height: 100%;
margin: 0 auto;
background: {
position: center;
size: contain;
repeat:no-repeat;
image:url($assetsDir+'/wap_logo@3x_581de69e.png');
};
}
}
-----------------------------------------------
html,
body,
div,
span,
object,
button,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
a,
code,
em,
img,
q,
small,
strong,
dd,
dl,
dt,
li,
ol,
ul,
fieldset,
form,
label,
table,
tbody,
tr,
th,
td,
input {
margin: 0;
padding: 0;
border: 0;
}
body {
position: relative;
width: 100%;
overflow-x: hidden;
}
ul,
li {
list-style-type: none;
}
a {
text-decoration: none;
}
html {
background: #fff;
font-family: 'STHeiti', 'Microsoft YaHei', 'Helvetica', 'Arial', sans-serif;
-webkit-text-size-adjust: none;
word-break: break-word;
}
.header {
height: 45px;
background-color: #d43d3d;
}
.header .title_logo {
width: 100%;
height: 100%;
margin: 0 auto;
background-position: center;
background-size: contain;
background-repeat: no-repeat;
background-image: url("assets/wap_logo@3x_581de69e.png");
}
--------------------------------------
html,
body,
div,
span,
object,
button,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
a,
code,
em,
img,
q,
small,
strong,
dd,
dl,
dt,
li,
ol,
ul,
fieldset,
form,
label,
table,
tbody,
tr,
th,
td,
input {
margin: 0;
padding: 0;
border: 0;
}
body {
position: relative;
width: 100%;
overflow-x: hidden;
}
ul,
li {
list-style-type: none;
}
a {
text-decoration: none;
}
@charset "utf-8";
html {
background: #fff;
font-family: 'STHeiti', 'Microsoft YaHei', 'Helvetica', 'Arial', sans-serif;
-webkit-text-size-adjust: none;
word-break: break-word;
}相似问题