gpt4 book ai didi

html - 字间距问题

转载 作者:太空宇宙 更新时间:2023-11-04 06:51:36 26 4
gpt4 key购买 nike

我正在尝试重新创建 Google 的主页,以尝试提高我的基本技能。我正在尝试将字间距应用到导航栏(Gmail 和图片)中的链接,但我无法让它工作。谁能指出我哪里出错了?

我刚刚意识到 list-style-type: none;也没有改变任何东西。

html {
width: 100%;
padding: 0;
margin: 0;
}

.mainSection {
text-align: center;
margin-top: 10%;
}

input {
display: block;
margin-right: auto;
margin-left: auto;
margin-top: 1%;
border: none;
padding: 10px;
width: 500px;
border: 1px solid lightgray;
outline: none;
font-size: 20px;
font-weight: lighter;
box-shadow: 0px 0px 18px -1px rgba(166, 166, 166, 0.93);
}

button {
outline: none;
margin-top: 3%;
display: inline-block;
width: 150px;
height: 35px;
border: 1px solid #eaeaea;
outline: none;
background-color: #f2f2f2;
color: #636363;
font-weight: bold;
}

.divider {
width: 10px;
display: inline-block;
}

.nav-wrapper {
margin: 0;
padding: 0;
overflow: hidden;
}

.nav-wrapper a {
float: right;
list-style-type: none;
word-spacing: 30px;
}
<nav>
<div class="nav-wrapper">
<a href="#" class="gmail">Gmail</a>
<div class="dividerTwo"></div>
<a href="#" class="images">Images</a>
<!-- Add sign-in button here -->
</ul>
</div>
</nav>
<main>
<div class="mainSection">
<img id="googleImg" src="googlemain.png" alt="Google" draggable="false">
<div id="search">
<input type="text">
<button id="Search" href="#">Google Search</button>
<div class="divider"></div>
<button id="Lucky" href="#">I'm Feeling Lucky</button>
</div>
</div>
</main>

最佳答案

padding-left 可以正常工作。

      .nav-wrapper a {
float: right;
order:1;
text-decoration:none;
padding-left:10px;
}

<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Google</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>

html {
width: 100%;
padding: 0;
margin: 0;
}

.mainSection {
text-align: center;
margin-top: 10%;
}


input {
display: block;
margin-right: auto;
margin-left: auto;
margin-top: 1%;
border: none;
padding: 10px;
width: 500px;
border:1px solid lightgray;
outline:none;
font-size: 20px;
font-weight: lighter;
box-shadow: 0px 0px 18px -1px rgba(166,166,166,0.93);
}

button {
outline: none;
margin-top: 3%;
display: inline-block;
width: 150px;
height: 35px;
border: 1px solid #eaeaea;
outline: none;
background-color: #f2f2f2;
color: #636363;
font-weight:bold;
}

.divider {
width:10px;
display: inline-block;
}

.nav-wrapper {
margin: 0;
padding: 0;
overflow: hidden;
}

.nav-wrapper a {
float: right;
order:1;
text-decoration:none;
padding-left:10px;
}


</style>
</head>

<body>
<nav>
<div class="nav-wrapper">
<ul>
<a href="#" class="gmail">Gmail</a>
<div class="dividerTwo"></div>
<a href="#" class="images">Images</a>
<!-- Add sign-in button here -->
</ul>
</div>
</nav>
<main>
<div class="mainSection">
<img id="googleImg" src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" alt="Google" draggable="false">
<div id="search">
<input type="text">
<button id="Search" href="#">Google Search</button>
<div class="divider"></div>
<button id="Lucky" href="#">I'm Feeling Lucky</button>
</div>
</div>
</main>
</body>

</html>

关于html - 字间距问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52816834/

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