如何内联两个不同的盒子

提问者

我的问题是我有一个带标签的对象框和一个iFrame,这是我希望代码执行的一个示例

[boz] [box] [box]

但这就是我得到的。

[box]
[box]
[box]

CSS:

.stream {
   display: inline;
}

HTML:

<div class="stream">


        <object type="application/x-shockwave-flash"
          height="350"
          width="390" 
          id="live_embed_player_flash"
          data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=username"
          bgcolor="#000000">
          <param name="allowFullScreen" value="true" />
          <param name="allowScriptAccess" value="always" />
          <param name="allowNetworking" value="all" />
          <param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" />
          <param name="flashvars" value="hostname=www.twitch.tv&channel=username&auto_play=true&start_volume=25" />
        </object>

             <a href="http://www.twitch.tv/username" 
              style="padding:2px 0px 4px; 
              display:block; width:345px; 
              font-weight:normal; 
              font-size:10px;text-decoration:underline; 
              text-align:center;">Watch live video from username on www.twitch.tv
             </a>


        <iframe 
          frameborder="0" 
          scrolling="no" 
          id="chat_embed" 
          src="http://twitch.tv/chat/embed?channel=username&popout_chat=true" 
          height="350" 
          width="300">
        </iframe>
</div>

有解决方案的人吗?

G-西里尔

我的评论还没有完全被理解:)

 .stream a, 
.stream object,
.stream iframe{ 
  display: inline-block;
  vertical-align:middle;
}

http://codepen.io/gc-nomade/pen/LHwfj

如果您删除了display:blockinline样式的<a>tag,则可以使用。

编辑:确保它们保持一行,您可以添加:

.stream {white-space:nowrap;} 
.stream * {white-space:normal;} 

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章