简体   繁体   English

浮动权利在IE 7中不起作用,但在FF IE8中起作用

[英]Float right is not working in IE 7 but works in FF IE8

I have this code 我有这个代码

<div id="facebook_bar"> 
  <div style="float:left;">
  <img src="images/topbar_followus.png" width="70" height="25" /> 
  <img src="images/topbar_twitIcon.png" width="30" height="25" /> 
  <img src="images/topbar_fbicon.png" width="30" height="25" />
  </div>
    <div id="newsletter_box"> 


   <img src="images/topbar_subscribe.png" width="220" height="25" />
      <input type="text" name="cm-ktkykk-ktkykk" id="ktkykk-ktkykk" />
      <input type="image" src="images/btn_submit.png" width="55" height="25" />

      </div>
  </div>

css is CSS是

#facebook_bar {
 background-color:#323334;
 height:30px;
 padding-top:15px;
 padding-left:20px;
 padding-right:20px;
}
#newsletter_box {
 float:right;
 /*margin-top:-30px;*/

}

The right hand div is showing on next line after the first div not on the same line 右div显示在第一个div之后的下一行而不是同一行

I initally posted this as a comment but might as well give you it as an answer. 我最初将其发布为评论,但也可能将其作为答案。

Why don't you just use float:left for both #newsletter_box and the inline floated div. 为什么不对#newsletter_box和内联float:left div只使用float:left #newsletter_box This will ensure they both sit at the same position vertically, you can then adjust the horizontal positioning using % widths. 这样可以确保它们都垂直位于同一位置,然后可以使用%宽度调整水平位置。

I'd also check out this article to clear the float because you have images involved. 我还将检查这篇文章以清除浮动内容,因为您涉及到图像。

您还需要浮动左栏,将float:left添加到#facebook_bar。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在IE8 / 9中无法使用悬停导航,在FF / Chrome中可以使用 - Cannot get hover navigation working in IE8/9, works in FF/Chrome 用float左右对齐:在FF / IE中有效,但在Chrome中不可用? - align left and right with float: works in FF/IE but not in Chrome? 浮动权在IE中不起作用 - float right not working in IE .animate()在IE10中不起作用,但在IE9,IE8,IE7,Chrome和FF中起作用 - .animate() doesn't work in IE10 but works in IE9, IE8, IE7, Chrome, and FF 浮动图像就在ol的li,文本左侧,在Chrome中运行,而不是IE / FF - Float image right within li of ol, text left, works in Chrome, not IE/FF 图像不适合表格,IE(IE8,IE9)中的td在FF中效果很好 - Image not fitting to table, td in IE(IE8,IE9), works well in FF z-index IE8无法正常工作,而在FF中 - z-index IE8 not working, while in FF it is CSS样式可在Chrome / FF中使用,但不适用于IE8 - CSS style working in Chrome/FF but not applying in IE8 如何在jqGrid上实现wordwrap,它适用于IE7,IE8和FF - How to implement wordwrap on jqGrid which works on IE7, IE8 and FF jQuery colorbox在IE8中不起作用(但在IE7中起作用?) - jQuery colorbox not working in IE8 (But works in IE7?)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM