[英]How do you make the Bootstrap navbar logo and menu have "padding" on the left and right, respectively?
Right now, the logo and menu are aligned to the far-left and far-right of the screen on my website.现在,徽标和菜单与我网站上屏幕的最左侧和最右侧对齐。 I would like them to stay a set percentage distance (as opposed to absolute distance) away from the extremes so that it works well even when you resize the page.
我希望他们与极端值保持一定的百分比距离(而不是绝对距离),以便即使在调整页面大小时它也能正常工作。
Thanks.谢谢。
I think you want to have your logo and menu some space from the left & right of the screen, if it is true then you can give padding to the left & right of the navbar itself it will automatically push the logo and menu towards the middle of the screen here is the code you can follow.我认为您希望您的徽标和菜单从屏幕的左右两侧留出一些空间,如果是这样,那么您可以在导航栏本身的左右两侧进行填充,它会自动将徽标和菜单推向中间这里的屏幕是您可以遵循的代码。
<nav class="navbar">
// YOUR CODE GOES HERE
</nav>
.navbar{
padding: 0 20px //insted of 20px you can give it in X% as well.
}
and, If I miss understood the question please let me know.而且,如果我错过了理解这个问题,请告诉我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.