开发者

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

开发者 https://www.devze.com 2022-12-30 21:37 出处:网络
I have this code <div id=\"facebook_bar\"> <div style=\"float:left;\"> <img src=\"images/topbar_followus.png\" width=\"70\" height=\"25\" />

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/topba开发者_Python百科r_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

#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


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. 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.


You need to float the left bar as well, add float:left to #facebook_bar.

0

精彩评论

暂无评论...
验证码 换一张
取 消