gpt4 book ai didi

html - div 中的 元素从底部略微升高

转载 作者:太空宇宙 更新时间:2023-11-04 12:22:23 24 4
gpt4 key购买 nike

我正在制作一个博客网站,并且在帖子标题 div 中有一个元素:

<html>
<head>
<title>A Simple Blog</title>
<link type="text/css" rel="stylesheet" href="/stylesheets/blogstyle.css">
</head>

<body>
<h1 class="heading">BLOG</h1>


<div class="post">
<div class="post-heading">
<a class="post-title" href="/blog/5066549580791808">The Dark &amp; Light of Francisco Goya</a>
<div class="post-date">March 1, 2015</div>
</div>
<div class="post-content">In the summer of 1969, as the violence intensified in Northern Ireland, the poet Seamus Heaney was in Madrid. Like any tourist, he went to the Prado, but not specifically, he later said, “to study examples of art in a time of violence.” He found, nonetheless, that some of Francisco Goya’s work on display “had the force of terrible events…. All that dread got mixed in with the slightly panicked, slightly exhilarated mood of the summer as things came to a head in Derry and Belfast.” He found Goya’s work “overwhelming,” and was fascinated at the idea of an artist confronting political violence “head-on.” In his poem “Summer 1969,” he wrote of his time in the heat of the Spanish city while Belfast burned:</div>
</div>


</body>

</html>

样式表代码:

body {
position: relative;
padding: 10px;
margin: 0 auto;
font-family: Arial, Helvetica, sans-serif, Times;
background-color: #FFFFE6;
width: 1000px;
}

.post-heading {
height: 45px;
border-bottom: 2px solid black;
position: relative;
}
.post-title {
font-family: "URW Palladio L","URW Gothic","Times New Roman",Times,serif;
font-size: 30px;
color : #444;
text-decoration: none;
}

.post-date {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
position: absolute;
right: 0px;
bottom: 0px;
color: #999;
}

.post-content {
margin-top: 5px;
font-family: Georgia,Times New Roman, sans-serif;
}

这是我屏幕上的网站预览:

enter image description here

高亮<a class="post-title">之间有空隙和 parent <div class="post-heading"></div>元素。您必须将注意力集中在底部的蓝色框和黑色边框之间,才能看到图片中的间隙。

这个差距快把我逼疯了!

为什么会出现这个差距,我该如何摆脱它?

最佳答案

关于html - div 中的 <a> 元素从底部略微升高,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28266749/

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