gpt4 book ai didi

html - 如何修复背景颜色 CSS/HTML 部分中的空白

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

我将我的页面分成“部​​分”,但无法摆脱每个部分上方和下方的空白区域。任何提示都会很棒!!

Imgur

亮黄色只是为了表明它发生在下面的下一部分。

我已经尝试移除所有部分以及正文的填充和边距,但那条白色间距的小条仍然存在。我还尝试将部分更改为 div 以及将我的 img 放入 href 或另一个 div。不知道为什么我会收到这个!

HTML:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Fun Project | Kay Larson</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<header>
<div class="header__left-side">
<img class="logo-placeholder" src="logo-placeholder.jpeg">
<span class="header__titles">
<h1>KAYLA LARSON</h1>
<h2>web designer</h2>
</span>
</div>
<div class="header__right-side">
</div>
<div class="header__social-icons">
<a href="https://www.facebook.com/kayla.larson.710">
<img src="icons/facebook-logo-button.svg" class="img__fb">
</a>
<a href="https://www.linkedin.com/in/kaylalarson4/">
<img src="icons/linkedin-button.svg" class="img__linkedin">
</a>
<a href="https://twitter.com/Kay60372608">
<img src="icons/twitter.svg" class="img__twitter">
</a>
</div>
</header>
<a href="#">
<img src="images/Kayla Larson - F.jpg" class="img__self">
</a>
<section class="section__top-get-started">
<h2 class="h__get-started">Creating Things. <br> Happy Mind.</h2>
<h3 class="h3__get-started">The ways creating can improve your life.</h3>
<button class="btn__get-started">Let's Start</button>
</section>
<section class="section__about-me">
<h2>Who I Am</h2>
<h3>I'm Kay, a Web Developer.</h3>
<p class="section__body-para">I'm a paragraph. Click here to add your own text and edit me. It’s easy. Just click “Edit Text” or double click me to add your own content and make changes to the font. Feel free to drag and drop me anywhere you like on your page. I’m a great place for you to tell a story and let your users know a little more about you.

This is a great space to write long text about your company and your services. You can use this space to go into a little more detail about your company. Talk about your team and what services you provide. Tell your visitors the story of how you came up with the idea for your business and what makes you different from your competitors. Make your company stand out and show your visitors who you are.</p>
<button class="btn__contact-me">Contact Me</button>
</section>
<section class="section__more-info">
<h2>For More Information</h2>
<form class="form__subscribe">
<h4>Subscribe</h4>
<input type="test" name="Subscribe" placeholder="Enter your email here">
<button class="btn__submit">Submit</button>
</form>
</section>
<script src="main.js"></script>
</body>
</html>

CSS:

* {
box-sizing: border-box;
}

body {
margin: 0;
}

a {
text-decoration: none;
}

.header__left-side {
display: flex;
}

.logo-placeholder {
height: 75px;
margin: 30px 10px 10px;
width: 100px;
}

.header__titles {
margin: 30px 0px 10px;
}

h1 {
font-family: "Playfair Display", serif;
font-size: 1em;
font-weight: 300;
margin-bottom: 0;
}

h2 {
font-family: "Lato", sans-serif;
font-size: 1em;
font-weight: lighter;
letter-spacing: 2px;
margin-top: 2px;
}

.img__fb,
.img__linkedin,
.img__twitter {
height: 20px;
margin: 0 10px 10px;
}

.img__self {
width: 100%;
}

.section__top-get-started {
background-color: #fdf9ba;
display: flex;
flex-direction: column;
}

.h__get-started {
position: relative;
margin: 45px 0px 5px;
left: 20px;
width: 280px;
line-height: 1.3em;
font-size: 2em;
text-align: center !important;
}

.h3__get-started {
width: 280px;
font-family: "Garamond", sans-serif;
font-weight: 100;
position: relative;
margin: 0px 0px 18px;
left: 20px;
grid-area: 2 / 1 / 3 / 2;
line-height: 1.6em;
font-size: 1em;
text-align: center;
}

.btn__get-started {
height: 45px;
min-height: 19px;
width: 104px;
position: relative;
margin: 0px 0px 36px 0;
left: 108px;
color: #fff;
background-color: grey;
}

最佳答案

我想知道那些边框是不是来自图像本身

<img src="images/Kayla Larson - F.jpg" class="img__self">

如果你能提供图片,它会更容易看到。

关于html - 如何修复背景颜色 CSS/HTML 部分中的空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55873782/

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