IE8和IE8以下的IE版本如何设置按钮的垂直居中的样式?_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:29:08
Original
1181 people have browsed it

<asp:Button  ID="Button1"  runat="server"  OnClick="Button1_Click"   CssClass="btn7"  />
Copy after login


我先试着写了一个样式

#btn7{vertical-align:middle; overflow:hidden;position:relative; display:inline-block;}
Copy after login



可是不起作用,按钮Button1还是没垂直居中

请问这个样式应该如何写?


回复讨论(解决方案)

前面写错了,应该是

.btn7{vertical-align:middle; overflow:hidden;position:relative; display:inline-block;}
Copy after login

怎么没人回答?

谁来帮帮我啊

今天谁第一个回复这个贴子,我就把分数给谁

vertical-align指的是在当前 行的垂直位置
外层节点设置一个和高度相同的line-height,再给外层加个vertical-align:middle试试,或者外面用table,自动居中
 分分能领吗

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template