[英]Why do some of my tabs cause my content to shift slightly to the right?
I have created a very rough mockup for a registration site I'm building that uses bootstrap tabs. 我为正在构建的使用引导程序选项卡的注册站点创建了一个非常粗糙的模型。 However, when I select a few of my tabs, I notice all of the content gets shifted to the right by a few pixels.
但是,当我选择一些选项卡时,我注意到所有内容都向右移动了几个像素。
See here for my code, as it's too long to paste here. 请参阅此处获取我的代码,因为粘贴到这里太长了。 I don't think my JavaScript files would affect the appearance of the page when switching tabs, but if so, I'll attach them here if needed.
我认为我的JavaScript文件在切换标签页时不会影响页面的外观,但是如果是这样,我会在需要时将它们附加在此处。
Notice how the page's content gets shifted to the right by a few pixels when switching from one of the following tabs: Personal Info
, State/Federal
, Ethnicity
, Birthplace/Language
, Medical
, or School Release
tab to either the Contact/Siblings
, Placement
, or Emergency Contact
tab. 从以下选项卡之一切换时,请注意页面内容如何向右移动几个像素:“
Personal Info
,“ State/Federal
,“ Ethnicity
,“ Birthplace/Language
,“ Medical
”或“ School Release
选项卡到“ Contact/Siblings
,“ Placement
,或“ Emergency Contact
标签。
I believe it's because of the content height, on some tabs the vertical scrollbar shows up and pushes the content causing the shift. 我相信这是因为内容的高度,在某些选项卡上,垂直滚动条显示出来并推动内容引起移位。 You can make the scrollbar show all the time by adding
overflow-y: scroll;
您可以通过添加
overflow-y: scroll;
使滚动条始终显示overflow-y: scroll;
to the body
element. body
元素。
body {
overflow-y: scroll;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.