2 divs 50%inline block不相邻 [英] 2 divs 50% inline block not next to each other

查看:104
本文介绍了2 divs 50%inline block不相邻的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到这个盒子模型的问题。我只有与黑莓4.6问题,但它发生在jsbin / jsfiddle以及。

I'm having issues with this box model. I was having the issue only with Blackberry 4.6, but it's happening on jsbin/jsfiddle as well. These 2 divs should be 50% and therefore sit directly next to each other, but the last one is breaking down.

jsbin: http://jsbin.com/oyujof/1/edit

提前感谢。

推荐答案

对于inline和inline-block元素,空格是重要的。删除或注释div之间的空格。

Whitespace is significant when it comes to inline and inline-block elements. Remove or comment out the whitespace between the divs.

澄清:空格是换行符和div之间的空格:

Clarification: the whitespace is the newline character and spaces between the divs:

  </div>\n
  __<div class="nav-button">

当您使用内联或内联块时,这些将显示为单个空格。

These will render as a single space when you use inline or inline-block.

这篇关于2 divs 50%inline block不相邻的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆