HTML CSS Footer : Exact Same specifications, 但垂直对齐方式不同;为什么?

标签 html css footer

我有一个页脚,两个左浮动 div 并排放置;一侧用于一些文本,另一侧用于一些链接。它们都链接到相同的 CSS,具有完全相同的规范,但左侧文本低于右侧链接。

我已经从一堆东西中删除了填充、边距和边框,但我似乎无法弄清楚。

感谢您的帮助,这是我的代码:

HTML

 <!--FOOTER-->
    <footer>
        <hr class="plain bgcolor black">
        <div class="footerl">
            <p class="grey footer">
            <span style="font-family:Bodoni MT W01 Bold, Times New Roman, serif">B O R I S &nbsp; K H O L O D O V</span> &nbsp;&#183;&nbsp; Real Estate Broker
            </p>
        </div>
        <div class="footerr">
            <navigation>
                <a class="grey footer" href="index.html">Home&nbsp;&nbsp;&nbsp;</a><a class="grey footer" href="listings.html">&nbsp;&nbsp;&nbsp;Listings&nbsp;&nbsp;&nbsp;</a><a class="grey footer" href="approach.html">&nbsp;&nbsp;&nbsp;Approach&nbsp;&nbsp;&nbsp;</a><a class="grey footer" href="press.html">&nbsp;&nbsp;&nbsp;Press&nbsp;&nbsp;&nbsp;</a><a class="grey footer" href="contact.html">&nbsp;&nbsp;&nbsp;Contact</a>
            </navigation>
        </div>
        <hr class="plain bgcolor black">
    </footer>
    <!--FOOTER-->

CSS

navigation{
    padding: 0px;
    margin: 0px;
    border: 0px;
    }

footer{
    padding: 0px;
    margin: 0px;
    border: 0px;}

div.footerl{
    height: 25px; 
    width: 500px;
    float: left;
    padding-left: 0px;
    padding-right: 0px;
    padding-top: 10px;
    padding-bottom: 10px;
    margin: 0px;
    }

div.footerr{
    height: 25px; 
    width: 500px;
    float: left;
    text-align: right;
    padding-left: 0px;
    padding-right: 0px;
    padding-top: 10px;
    padding-bottom: 10px;
    margin: 0px;
    }

.footer{
    font-family: "DIN Next W01 Light", Helvetica, Arial, sans-serif;
    font-size:14px;
    margin: 0px;
    padding: 0px;
    text-decoration:none;}

最佳答案

与右侧的链接相比,不同的字体系列/大写可能会使左侧的文本稍微偏移。

line-height 属性添加到 div.footerl 以将文本向下推一点:

div.footer1 {
    line-height: 1.5em;
}

关于HTML CSS Footer : Exact Same specifications, 但垂直对齐方式不同;为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28440562/

相关文章:

html - 导航栏上方的间隙?

css - 褪色图像网页设计

jquery - 背景图像淡入淡出有效,但不是第一次触发

android - 当软键盘启动时停止页脚出现 : android

html - 新手 HTML5 和 CSS3 问题与定位一些图标

jQuery carousel new style next 和 prev 在第一张和最后一张幻灯片上

php - 通过php和html为mysql数据库创建excel文件

javascript - JQuery 无法重新排序列表中的元素;怎么修?

javascript - 使用 jquery 为多个浏览器设置 flexbox 显示?

css - 使用 YUI 是否可以添加另一个粘在页面底部的 css 页脚?