Blueprint CSS - 使用它的高级规则
今天早上美国东部时间上午 8 点左右我开始使用 Blueprint CSS,我发现自己有以下问题:
我什么时候使用容器类?
我应该如何从概念上考虑容器?
容器类需要跨度类吗?为什么或为什么不?
容器类需要最后一个类吗?为什么或为什么不?
一个容器可以在另一个容器内吗?
推/拉类的意义是什么?我不能只用追加/前置来定位事物吗?
如果我使用像 .right、.left 这样的 float 类,我还需要指定 span-x 和 last 吗?
如何使行更高?
如何将某些内容在一行中垂直居中?
如何使根容器距离页面左侧 20 像素而不是居中?
I started using Blueprint CSS at about 8AM EDT this morning and I find myself having the following questions:
When do I use the container class?
How should I think of container conceptually?
Do container classes need a span class? Why or why not?
Do container classes need a last class? Why or why not?
Can a container be inside another container?
What is the point of push/pull classes? Can't I just position things with append/prepend?
If I use a float class like .right, .left, do I still need to specify a span-x and last?
How do I make a row taller?
How do I center something vertically in a row?
How do I make the root container be 20px from the left of the page instead of having it centered?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看源代码可以让你了解很多。这是容器类:
它只是一个大页面包装器。大多数人使用它一次来包装页面上的所有 HTML,使其居中且宽度为 950 像素。
追加/前置添加填充。推/拉“移动”边距。
这些 CSS 框架的重点是避免处理您自己的浮动。
向该行添加更多内容或为其指定高度样式。
如果坚持网格,您可以使用追加/前置将其置于网格中心。如果你不坚持网格,你可以使用任何典型的 CSS 方法(通常是 margin: auto)
回到问题 #1 并查看 CSS 类。改变这一点。
在大多数情况下,一旦您掌握了它的窍门(您很快就会掌握),蓝图及其类似工具都是相当基本的工具。它的主要目的是处理将页面布局成块并为您处理所有浮动逻辑。一旦掌握了它的窍门,您可能会发现自己不再需要框架,并且通常会根据需要创建自己的框架,以适应您正在处理的任何网站的特殊性。
Viewing source can show you a lot. This is the container class:
It's just a big page wrapper. Most people use it once to wrap all the HTML on the page so it's centered and 950 px wide.
append/prepend adds padding. push/pull 'shifts' margins.
The whole point of these CSS frameworks is to avoid dealing with your own floats.
Add more stuff to the row or give it a height style.
If sticking to the grid, you'd use append/prepend to center it on the grid. If you're not sticking to the grid, you'd use any typical CSS approach (typically margin: auto)
Go all the way back to question #1 and look at the CSS class. Change that.
For the most part, Blueprint and it's ilk are fairly basic tools once you get the hang of it (which you will in a matter of time). It's primary purpose is to handle laying out the page into blocks and dealing with all the float logic for you. Once you get the hang of it, you'll likely find yourself not needing a framework anymore and will typically whip up your own as needed to fit the particularities of whatever site you happen to be working on.