我正在使用Bootstrap和一个带有navbar-fixed-top类的导航栏。 下面是一个内部有图像的div(屏幕的全宽,高度为400px)。
问题是,由于我的导航栏具有背景颜色,导航栏会进入图像。 我尝试在图像上添加一个margin-top:80px,它工作正常,但当我低于769px x XXXpx时,我的导航栏和我的图像之间出现了一个空格。 我知道在调整窗口大小时这个空间来自边缘顶部,但是我可以做什么来将图像设置在导航栏下方而不添加边距顶部以使其正确显示?
我认为这是一个简单的问题所以我没有在我的帖子中添加代码,如果需要,我会。
I'm using Bootstrap and a navbar with navbar-fixed-top class on it. Below that is a div with an image inside (full width of the screen, height 400px).
The problem is that, since my navbar has a background-color, the navbar goes onto the image. I tried to add a margin-top:80px on the image, it works fine, but when I go below 769px x XXXpx, a space appears between my navbar and my image. I know this space is coming from the margin-top when resizing the window, but what could I do to set the image below the navbar without adding a margin-top for it to appear correctly ?
I thought this was simple issue so I didn't add code to my post, I will if needed.
最满意答案
尝试为图像包装CSS规则
@media (min-width: 768px) { your CSS rule for image margin-top: 80px here }Try to wrap CSS rule for image in
@media (min-width: 768px) { your CSS rule for image margin-top: 80px here }更多推荐
发布评论