CSS 宽度 100% 超出界限
Take a look at this;
Why is the 100% width tab exceeding the container? The content in the container also has a 100% width and this works just fine?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因为内容区域的宽度是100%,那么就得加上margin、border、padding...
试试:
box-sizing: border-box;宽度:100%;
Because the width of the content area is 100%, then you have to add margin, border, padding...
Try:
box-sizing: border-box; width: 100%;
这是因为内边距 10px。
那些额外的 20px(左右各 10px)会导致溢出。如果你安装了 firebug 或类似的工具,这些事情就很容易弄清楚。
That's because of the padding 10px.
Those extra 20px ( 10px from left and right ) is causing the overflow. If you have firebug installed or a tool like that, such things can be easily figured out.