如何删除导航栏和我发布的内容之间的空间? 我的顶部图片或发布的内容不是内联(水平)他们的位置像staire情况,除了顶级内容所有conntent是水平的,并且内联 博客之外它工作得很好,但在我的博客中它会产生问题。 请帮我解决这个问题 plz help me
这是我的帖子编码我认为我的编码很好,但我不知道问题出在哪里
/* Three columns side by side */
.column {
float: left;
width: 33.3%;
margin-bottom: 16px;
padding: 0 8px;
}
/* Display the columns below each other instead of side by side on small screens */
@media (max-width: 650px) {
.column {
width: 100%;
display: block;
}
}
/* Add some shadows to create a card effect */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
/* Some left and right padding inside the container */
.container {
padding: 0 16px;
}
/* Clear floats */
.container::after, .row::after {
content: "";
clear: both;
display: table;
}
.title {
color: grey;
}
.button {
border: none;
outline: 0;
display: inline-block;
padding: 8px;
color: white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
}
.button:hover {
background-color: #555;
}

<div class="row">
<div class="column">
<div class="card">
<img src="https://4.bp.blogspot.com/-E45A7HvB6kI/WWzbx3gV9AI/AAAAAAAABrQ/P0LKJRW_dlQyMvumgMgzDdPVWmky7-jygCPcBGAYYCw/s1600/Faisal%2BAmin.jpg" alt="Jane" style="width:100%">
<div class="container">
<h2>
Jane Doe</h2>
<p class="title">
CEO & Founder</p>
<p>
Some text that describes me lorem ipsum ipsum lorem.</p>
<p>
example@example.com</p>
<p>
<button class="button">Contact</button></p>
</div>
</div>
</div>
<div class="column">
<div class="card">
<img src="https://www.w3schools.com/w3images/team2.jpg" alt="Mike" style="width:100%">
<div class="container">
<h2>
Mike Ross</h2>
<p class="title">
Art Director</p>
<p>
Some text that describes me lorem ipsum ipsum lorem.</p>
<p>
example@example.com</p>
<p>
<button class="button">Contact</button></p>
</div>
</div>
</div>
<div class="column">
<div class="card">
<img src="https://www.w3schools.com/w3images/team1.jpg" alt="John" style="width:100%">
<div class="container">
<h2>
John Doe</h2>
<p class="title">
Designer</p>
<p>
Some text that describes me lorem ipsum ipsum lorem.</p>
<p>
example@example.com</p>
<p>
<button class="button">Contact</button></p>
</div>
</div>
</div>
</div>
&#13;
答案 0 :(得分:0)
在Css中添加以解决内联问题:
/* Added Style in Class ROW*/
.row{
display: inline-flex;
}
在Css中添加解决保证金问题:
/* Added Style To Remove Space */
.post {
margin: -175px 0 25px 0;
}
/* Added Style in Class ROW*/
.row{
display: inline-flex;
}
/* Added Style To Remove Space */
.post {
margin: -175px 0 25px 0;
}
/* Three columns side by side */
.column {
float: left;
width: 33.3%;
margin-bottom: 16px;
padding: 0 8px;
}
/* Display the columns below each other instead of side by side on small screens */
@media (max-width: 650px) {
.column {
width: 100%;
display: block;
}
}
/* Add some shadows to create a card effect */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
/* Some left and right padding inside the container */
.container {
padding: 0 16px;
}
/* Clear floats */
.container::after, .row::after {
content: "";
clear: both;
display: table;
}
.title {
color: grey;
}
.button {
border: none;
outline: 0;
display: inline-block;
padding: 8px;
color: white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
}
.button:hover {
background-color: #555;
}
&#13;
<div class="row">
<div class="column">
<div class="card">
<img src="https://www.w3schools.com/w3images/team4.jpg" alt="Jane" style="width:100%">
<div class="container">
<h2>
Jane Doe</h2>
<p class="title">
CEO & Founder</p>
<p>
Some text that describes me lorem ipsum ipsum lorem.</p>
<p>
example@example.com</p>
<p>
<button class="button">Contact</button></p>
</div>
</div>
</div>
<div class="column">
<div class="card">
<img src="https://www.w3schools.com/w3images/team2.jpg" alt="Mike" style="width:100%">
<div class="container">
<h2>
Mike Ross</h2>
<p class="title">
Art Director</p>
<p>
Some text that describes me lorem ipsum ipsum lorem.</p>
<p>
example@example.com</p>
<p>
<button class="button">Contact</button></p>
</div>
</div>
</div>
<div class="column">
<div class="card">
<img src="https://www.w3schools.com/w3images/team1.jpg" alt="John" style="width:100%">
<div class="container">
<h2>
John Doe</h2>
<p class="title">
Designer</p>
<p>
Some text that describes me lorem ipsum ipsum lorem.</p>
<p>
example@example.com</p>
<p>
<button class="button">Contact</button></p>
</div>
</div>
</div>
</div>
&#13;