【发布时间】:2015-07-15 22:32:39
【问题描述】:
这是我正在尝试实现的原型。
这是我现在拥有的
我现在要做的是垂直对齐所有元素(spans 与图像和文本) - 我的帐户、卡片、旅行等。
这是我本节的 HTML 和 CSS
HTML:
<div id="header">
<img class ="header_component" src="Logo.PNG" />
<span class="header_component">
<img src="MyAccount.PNG"/><BR/>
My Account
</span>
<span class="header_component">
<img src="Cards.PNG"/> <BR />
Cards
</span>
<span class="header_component">
<img src="Cards.PNG"/> <BR />
Travel
</span>
<span class="header_component">
<img src="Rewards.PNG"/> <BR />
Rewards
</span>
<span class="header_component">
<img src="Business.PNG"/> <BR />
Business
</span>
</div>
CSS:
.header_component {
width: 12%;
float:left;
text-align: center;
vertical-align: middle;
}
我尝试应用从 Vertical Alignment 中学到的 vertical-align: middle 属性,但没有成功(span 中的元素未垂直对齐)。
有没有人知道任何可行的替代样式?
【问题讨论】:
-
尝试在.header_component的css上设置
height:100%; -
在我看来像一个钓鱼网站
-
关于 SO 的下一个问题 - “如何将 XSS 注入美国运通以重定向到我的网站?”
-
哈哈!赢了就分钱?
标签: html css user-interface prototype user-experience