css - div 中的文本自动移至底部

标签 css html

我的文本位于 div 的底部,但它需要位于 div 的顶部。

Picture of the issue.

我的 CSS 代码:

#pagetitle
{
    float: left;
    width: 472px;
    height: 109px;
    font-size: 80px;
    font-family: 'CodePro';
    padding: 0px;
    margin: 0px;
}

html, body{
    margin:0 !important;
    padding:0 !important;
    opacity: 0.99;

    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;

    background-color: #cfcfcf;
}

实时预览位于 link

最佳答案

试试这个:

#pagetitle
{
    line-height: 23px; /* or so, it depends on your need*/
}

关于css - div 中的文本自动移至底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14325032/

相关文章:

html - 如果 <div> 的内容太大放不下,如何向 <div> 添加滚动?

html - CSS/Ruby 初学者 - 为什么相邻的两个按钮大小不同?

css - 调整大小时,自定义图标不会留在标题的右侧

html - 如何在图像右侧显示这些文本元素?

javascript - 如何从跨度内的类中检索数据?

html - 李 :first-of-type selecting everything

html - 表格单元格溢出

css - heroku 和 django : server doesn't load staticfiles

php - 小Php和MySql问题

javascript - 如何将参数放入 windows.open 中的函数中?