简体   繁体   English

为什么我的某些标签会导致我的内容向右微移?

[英]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.

相关问题 为什么为FlashGallery添加此javascript会导致我的背景图像向上移动? - Why does adding this javascript for FlashGallery cause my background image to shift up? 为什么我的网站在 Safari 上向左移动? - Why does my website shift to the left on Safari? 为什么我的 html、css 和 javascript 内容在我的手机(不同平台)上向右移动? - Why is my html, css, and javascript content shifting to the right on my phone (different platforms)? 如何将此.tablink类添加到内容链接中,以使用JavaScript在标签之间进行链接 - How do I add this .tablink class to my in-content links to link between tabs with JavaScript 为什么尾随和前导零会导致我的函数返回我不想要的值? - Why do trailing and leading zeros cause my function to return values i do not want? 我是否需要Ajax或其他东西在选项卡中放入不同的erb内容? - Do I need Ajax or something to put different erb content in my tabs? 我的某些媒体查询工作,另一些则不行,不知道为什么 - Some of my Media Queries Work, Other's do not, No Idea Why 为什么有些浏览器弄乱了我的图像框? - Why do some browsers jumble up my image boxes? 我的左边位置由于某种原因未定位右边 - My left position is for some reason not positioning right 为什么我的angular-bootstrap选项卡不渲染? - Why are my angular-bootstrap tabs not rendering?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM