Html CSS如何垂直对齐我的文本和文本颜色
这是我现在的输出 这是我想要的输出 我的编码:Html CSS如何垂直对齐我的文本和文本颜色,html,css,Html,Css,这是我现在的输出 这是我想要的输出 我的编码: .buttons{ background-image:url("SlicingImage/button_unselect.png"); margin: none; height: 53px; width: 180px; text-transform:uppercase; text-align:center; position:relative; vertical-align:bottom; } HTML: <li class="butt
.buttons{
background-image:url("SlicingImage/button_unselect.png");
margin: none;
height: 53px;
width: 180px;
text-transform:uppercase;
text-align:center;
position:relative;
vertical-align:bottom;
}
HTML:
<li class="buttons">home</li>
主页
但一切都没有改变:(一般提示:如果只是一个链接而不是一个段落,请始终给
行高
等于div height,以使文本在中间垂直对齐此处将
行高:53px;
添加到类中一般提示:如果只是一个链接而不是段落,请始终给行高
等于div height可在中间垂直对齐文本此处将
行高:53px;
添加到类中垂直对齐:底部;
仅适用于表属性,如表单元格
或表行
因此:
您需要处理这个问题;这里有一个解释:
垂直对齐:底部;
仅适用于表属性,如表单元格
或表行
因此:
你需要玩这个游戏;这里有一个解释:试试这个:
.buttons{
background-image:url("SlicingImage/button_unselect.png");
margin: none;
/*height: 53px;
width: 180px;*/
padding: 30px 30px;
text-transform:uppercase;
text-align:center;
position:relative;
vertical-align:bottom;
}
试试这个:
.buttons{
background-image:url("SlicingImage/button_unselect.png");
margin: none;
/*height: 53px;
width: 180px;*/
padding: 30px 30px;
text-transform:uppercase;
text-align:center;
position:relative;
vertical-align:bottom;
}
垂直对齐对于您要执行的操作不起作用 您需要使用线条高度或填充来解决此问题 我会先试试线的高度
.buttons { line-height: 100px; }
并从代码中删除高度:53px。但相应地调整行高度
或者你也可以试试
.buttons { padding-top: 16px; }
并相应地调整垂直对齐对于您要执行的操作不起作用 您需要使用线条高度或填充来解决此问题 我会先试试线的高度
.buttons { line-height: 100px; }
并从代码中删除高度:53px。但相应地调整行高度
或者你也可以试试
.buttons { padding-top: 16px; }
并相应调整根据按钮高度使用线条高度当按钮处于活动状态时背景图像的外观和位置看起来不同根据按钮高度使用线条高度当按钮处于活动状态时背景图像的外观和位置看起来不同