我无法在按钮上添加填充,浏览器显示“属性值无效”

问题描述 投票:0回答:2

/*****************************/
/* overall setup*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #fff;
    color: #454545;
    font-family: 'Rubic';
    font-weight: 300;
    font-size: 20px;
    text-rendering: optimizeLegibility;
}
/******************************/

.row {
    max-width: 1140px;
    margin: 0;
}

header {
    background-image: linear-gradient(rgba(0, 0, 0, 0.7),rgba(0, 0, 0, 0.7)) ,url(images/business-1845350.jpg);
    background-size: cover;
    background-position: center;
    height: 100vh;
}
.hero-text-box {
    position: absolute;
    width: 1140px;
    top: 50%;
    right: 50%;
    transform: translate(65%, -50%);
}
h1 {
    margin: 0;
    color: #fff;
    font-size: 240%;
    font-weight: 300;
    letter-spacing: 1px;
    word-spacing: 4px;
}
.btn-full {
    display: inline-block;
    padding: 10px,30px;
    font-weight: 300;
}
<!DOCTYPE html>
<html dir="rtl" lang="he-IL">

    <head>
        <link rel="stylesheet" type="text/css" href="vendors/css/normalize.css">
        <link rel="stylesheet" type="text/css" href="vendors/css/grid.css">
        <link rel="stylesheet" type="text/css" href="resources//css/style.css">
        <link href="https://fonts.googleapis.com/css?family=Rubik:300,300i,400&display=swap&subset=hebrew" rel="stylesheet">
        <title>לימור מלול - יבוא בידיים טובות</title>
    
    </head>


    <body>
        <header>
            <div class="hero-text-box">
                <h1> יבוא מוצלח מתחיל כאן.<br> המרכז ליבואנים מתחילים. </h1>
                <a class="btn-full" href="#"> אני רוצה להתחיל לייבא </a>
                <a class="btn btn-outline" href="#"> אני רוצה לקרוא עוד </a>
            </div>
        </header>
    
    </body
</html>

我无法在btn-full类中添加填充。另外,我不确定英雄文本框是否居中,因为在此过程中我正在向他学习,而我是rtl。讲师使用的代码

.hero-text-box {
position: absolute;
width: 1140px;
top: 50%;
right: 50%;
transform: translate(-50%, -50%);

}您还能告诉我.hero-text-box部分上的代码是否正确并且与讲师的代码匹配吗?

帮手致谢

html css textbox padding center
2个回答
2
投票

这样写

.btn-full {
    display: inline-block;
    padding: 10px 30px; /*remove ',' */
    font-weight: 300;
}

0
投票

错误的速记语法。使用空格而不是逗号(,)。

https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties

如果padding属性具有两个值:

padding: 10px 30px;
© www.soinside.com 2019 - 2024. All rights reserved.