这是我的按钮元素:
<button type="submit" class="btn-submit"><span><strong>Let Me In, please!</strong></span></button>
这是CSS:
.btn-submit { margin: 0; padding: 0; border: none; font-family: Helvetica, Arial, sans-serif; font-size: 1.2em; line-height: 2em; font-weight: bold; color: #525252; background: none; }
.btn-submit span { display: block; float: left; height: 24px; margin: 0; padding: 0 0 0 5px; background: url(../images/btn-submit-left.png) no-repeat 0 0; }
.btn-submit strong { display: block; float: left; height: 24px; margin: 0; padding: 0 13px 0 8px; line-height: 2em; background: url(../images/btn-submit-right.png) no-repeat 100% 0; }
问题是在IE7中“请让我进来!”文字被切断 - 只有“让”出现。
删除span和strong类将完整显示文本,并将宽度设置为.btn-submit类。问题是我需要span和强类提供的背景图像,我不知道按钮文本会有多长,所以无法为.btn-submit类指定宽度。
这里的任何帮助很多赞赏。谢谢!
答案 0 :(得分:1)
是否有理由为height
和float
指定.btn-submit span
和.btn-submit strong
?如果不是,我建议你删除它们。这将解决ie7