Blueprint CSS 框架或任何网格系统:修复有边框的 div
我在尝试布局网站时遇到了一些问题。我正在使用 蓝图框架,当我将边框应用于我的 div 时,就会发生这种情况。因为它们的宽度是由 span-XX
(或 grid-xx
,正如我在 960gs),当我将边框应用于任何 div
元素时,它就会脱离网格,如这些图像所示 点击放大 点击缩放
我知道解决这个问题的唯一方法是更改元素的宽度,但随后框架的网格目的就结束了,因为我将不再拥有 span-XX
类。还有其他方法可以修复吗?
I've got some problems while trying to lay out my site. I'm using Blueprint Framework and it happens when I apply borders to my div. Since their width are controlled by span-XX
(or grid-xx
as I noticed in 960gs), the moment I apply borders to any div
element I have it goes out of the grid as seen in these images Click to zoom
Click to zoom
The only way I know to fix it is to change element's width, but then the framework's grid purpose finishes 'cause I won't have the span-XX
classes anymore. Is there any other way to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我理解正确的话,您有一个
span-24
或类似的东西,并且想要为其添加边框,对吗?我首选的方法是将边框添加到上面代码片段的
box
类中。If I understand it right, you have a
span-24
or something similar and want to add a border to it, right? My preferred way of doing it isand add the border to the
box
class for above snippet.如果您不想嵌套 div,您可以为边框列创建一些附加类。我使用 1px 边框,所以我创建了这样的类:
如果你想要跨越所有列的 div 周围的边框(例如蓝图中的 24),则应该再有一个。
然后我将这些类与跨度一起使用,例如:
If you don't want to nest divs, you can create a few additional classes for bordered columns. I'm using 1px borders, so I created classes like:
There should be one more if you want borders around divs spanning all columns (eg. 24 in blueprint).
I then use those classes together with the spans, for example: