博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
比较Bootstrap和Foundation CSS类的备忘单
阅读量:2511 次
发布时间:2019-05-11

本文共 6848 字,大约阅读时间需要 22 分钟。

We've been talking a lot this week about . It's a great front-end framework that is a solid alternative to the awesome and deserves at least a look at the before being dismissed. It does have a few features that Bootstrap doesn't.

This will be a simple article that will help alleviate moving from Bootstrap over to Foundation. We'll be comparing the classes for the main parts of both frameworks. For the most part, both frameworks can build out components of your site for you (grid, buttons, forms, tables), so here's the cheat sheet to see side-by-side classes:

本周我们一直在谈论 。 这是一个很棒的前端框架,是很棒的的可靠替代品,并且在被解雇之前至少应了解一下这些 。 它确实具有Bootstrap所没有的一些功能。

这是一篇简单的文章,将有助于减轻从Bootstrap迁移到Foundation的麻烦。 我们将比较两个框架主要部分的类。 在大多数情况下,这两个框架都可以为您构建网站的组件(网格,按钮,表单,表格),因此,这是速查表,用于了解并排的类:

元素类比较 ( Element Class Comparison )

Element Bootstrap Foundation
Alert .alert .alert-success .alert-danger .alert-info .alert-box .success .warning .info .round .radius .secondary
Buttons .btn .btn-default .btn-primary .btn-success .btn-info .btn-warning .btn-danger .btn-link .btn-lg .btn-sm .btn-xs .btn-block .button .tiny .small .large .secondary .success .alert .radius .round .disabled .expand
Lists .list-unstyled .list-inline .inline-list (will unstyle it also)
Labels .label .label-default .label-primary .label-success .label-info .label-warning .label-danger .label .success .alert .secondary .round .radius
Tables .table .table-striped .table-hover .table-bordered .table-condensed .active .success .info .warning .danger Tables are automatically formatted with borders, stripes, and headers. No extra style classes given.
Panels .panel .panel-default .panel-primary .panel-success .panel-info .panel-warning .panel-danger .panel .callout .radius No other colors provided and no syntax for having a header and body of the panel.
Progress Bars .progress-bar .progress-bar-success .progress-bar-info .progress-bar-warning .progress-bar-danger .progress-bar-striped .active .progress .small-# .large-# .secondary .success .alert .radius .round
Text Utilities .text-left .text-center .text-right .text-justify .text-nowrap .text-lowercase .text-uppercase .text-capitalize .text-muted .text-primary .text-success .text-info .text-warning .text-danger .text-left .text-right .text-center .text-justify .small-text-left (also works for medium, large, xlarge) .small-only-text-left (also works for medium, large, xlarge) .small-text-center (also works for medium, large, xlarge) .small-only-text-center (also works for medium, large, xlarge) .small-text-right (also works for medium, large, xlarge) .small-only-text-right (also works for medium, large, xlarge) .small-text-justify (also works for medium, large, xlarge) .small-only-text-justify (also works for medium, large, xlarge)
Visiblity Classes .visible-*-block .visible-*-inline .visible-*-inline-block .hidden-xs .hidden-sm .hidden-md .hidden-lg .show-for-small-only (medium, large, xlarge, xxlarge) .show-for-small-up (medium, large, xlarge, xxlarge) .hide-for-small-only (medium, large, xlarge, xxlarge) .hide-for-small-up (medium, large, xlarge, xxlarge) .show-for-landscape .show-for-portrait .show-for-touch .hide-for-touch .hidden-for-small-only (medium, large, xlarge, xxlarge) .hidden-for-medium-up (large, xlarge, xxlarge) .visible-for-small-only (medium, large, xlarge, xxlarge) .visible-for-medium-up (large, xlarge, xxlarge)
元件 引导程序 基础
警报 .alert .alert-成功.alert-danger .alert-info .alert-box。成功.warning .info .round .radius .secondary
纽扣 .btn .btn-default .btn-primary .btn-success .btn-info .btn-warning .btn-danger .btn-link .btn-lg .btn-sm .btn-xs .btn-block 。按钮。小。小。大。第二成功。警报半径。圆形。禁用。扩展
清单 .list-unstyled .list-inline .inline-list(也会取消样式)
标签 .label .label-default .label-primary .label-success .label-info .label-warning .label-danger .label .success .alert .secondary .round .radius
桌子 .table .table-striped .table-hover .table-bounded .table-condensed .active .success .info .warning .danger 表格会自动用边框,条纹和标题格式化。 没有给出额外的样式类。
面板 .panel .panel-default .panel-primary .panel-success .panel-info .panel-warning .panel-danger .panel .callout .radius没有提供其他颜色,也没有包含面板标题和主体的语法。
进度条 .progress-bar .progress-bar-success .progress-bar-info .progress-bar-warning .progress-bar-danger .progress-bar-striped .active .progress .small-#.large-#.secondary .success .alert .radius .round
文字工具 .text-left .text-center .text-right .text-justify .text-nowrap .text-smallcase .text-uppercase .text-capitalize .text-muted .text-primary .text-success .text-info .text警告.text-danger .text-left .text-right .text-center .text-justify .small-text-left(也适用于Medium,Large,xlarge).small-only-text-left(也适用于Medium,Large,xlarge) .small-text-center(也适用于中,大,xlarge).small-only-text-center(也适用于中,大,xlarge).small-text-right(适用于中,大,xlarge) .small-only-text-right(也适用于中,大,xlarge).small-text-justify(也适用于中,大,xlarge).small-only-text-justify(也适用于中,大, xlarge)
可见性等级 .visible-*-block .visible-*-inline .visible-*-inline-block .hidden-xs .hidden-sm .hidden-md .hidden-lg .show-for-small-only(中,大,xlarge,xxlarge).show-for-small-up(中,大型,xlarge,xxlarge).hide-for-small-only(中,大型,xlarge,xxlarge) )。为小图片隐藏(中,大,xlarge,xxlarge)。为风景显示。为肖像显示。为触摸显示。为触摸隐藏。为小隐藏(中型,大型,xlarge,xxlarge).hidden-for-medium-up(大型,xlarge,xxlarge).visible-for-small-only(中型,大型,xlarge,xxlarge).visible-for-medium-up(大,x大,xx大)

( Grid )

Bootstrap Foundation
.container .container-fluid .row .col-xs-# .col-sm-# .col-md-# .col-lg-# .col-xs-offset-# .col-sm-offset-# .col-md-offset-# .col-lg-offset-# .row .columns .small-# .medium-# .large-# .small-offset-# .medium-offset-# .large-offset-#
引导程序 基础
.container .container-fluid .row .col-xs-#.col-sm-#.col-md-#.col-lg-#.col-xs-offset-#.col-sm-offset-#.col -md-offset-#.col-lg-offset-# .row .columns .small-#.medium-#.large-#.small-offset-#.medium-offset-#.large-offset-#

Conclusion

It's interesting to see how each accomplishes certain tasks. Foundation uses universal classes like
.secondary,
.success,
.alert,
.radius, and
.round while Bootstrap prefixes its classes with the element like
.btn-,
.alert-, and
.panel-. This could act as a cheat sheet and also a comparison chart for what features are supported. Foundation has a lot of visibility classes compared to Bootstrap while Bootstrap has more flexibility in its table creation. This should serve as an easy guide to moving between the two front-end frameworks. If you need help finding the correct classes for a certain element, let this little cheat sheet be your guide.

Want More Foundation?

Here are some more articles to get you going with Foundation:

结论

有趣的是,每个人如何完成某些任务。 Foundation使用通用的类,例如
.secondary
.success
.alert
.radius
.round而Bootstrap在其类的
.btn-加上元素
.btn- -
.alert-
.panel- 。 这可以用作备忘单,也可以作为支持哪些功能的比较表。 与Bootstrap相比,Foundation具有许多可见性类,而Bootstrap在表创建方面具有更大的灵活性。 这应该作为在两个前端框架之间转换的简单指南。 如果您需要帮助以找到适合某个元素的正确类,请以该备忘单为指南。

需要更多基金会吗?

这里有一些其他文章可以帮助您开始使用Foundation:

翻译自:

转载地址:http://enywd.baihongyu.com/

你可能感兴趣的文章
centos添加开放端口
查看>>
React Native 开发笔记
查看>>
set 集合 深浅copy
查看>>
github使用记录
查看>>
DELETE语句总结
查看>>
MySQL常见错误码及说明
查看>>
关于inodes占用100%的问题及解决方法
查看>>
eCharts使用(二) 坐标系
查看>>
转换函数
查看>>
如何在jupyter中安装R
查看>>
[改善Java代码]集合运算时使用更优雅的方式
查看>>
iOS--app自定义相册--创建相簿,存储图片到手机
查看>>
LeetCode Weekly Contest 141
查看>>
ACM题目————星际之门(一)
查看>>
使用Nginx的X-Sendfile机制提升PHP文件下载性能
查看>>
数组中重复的数字
查看>>
使用block的时候,导致的内存泄漏
查看>>
Retrofit与RXJava整合(转)
查看>>
前端界面操作DataTable数据表2
查看>>
《Apache服务之php/perl/cgi语言的支持》RHEL6——服务的优先级
查看>>