2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
id: bad87fee1348bd9aec908850
|
2021-03-05 02:55:32 +00:00
|
|
|
|
title: 给 Bootstrap 按钮添加默认样式
|
2018-10-10 22:03:03 +00:00
|
|
|
|
challengeType: 0
|
2020-09-07 08:17:39 +00:00
|
|
|
|
forumTopicId: 16657
|
2021-01-13 02:31:00 +00:00
|
|
|
|
dashedName: apply-the-default-bootstrap-button-style
|
2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --description--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2021-03-05 02:55:32 +00:00
|
|
|
|
Bootstrap 还有另外一种按钮 class 属性叫做 `btn-default`。
|
2020-09-07 08:17:39 +00:00
|
|
|
|
|
2021-03-05 02:55:32 +00:00
|
|
|
|
为所有的 `button` 元素增加两个 class: `btn` 和 `btn-default`。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --hints--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2021-03-05 02:55:32 +00:00
|
|
|
|
应该将 `btn` class 添加到所有的 `button` 元素中。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
```js
|
|
|
|
|
assert($('.btn').length > 5);
|
2018-10-10 22:03:03 +00:00
|
|
|
|
```
|
|
|
|
|
|
2021-03-05 02:55:32 +00:00
|
|
|
|
应该将 `btn-default` class 添加到每一个 `button` 元素中。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
```js
|
|
|
|
|
assert($('.btn-default').length > 5);
|
2018-10-10 22:03:03 +00:00
|
|
|
|
```
|
|
|
|
|
|
2021-01-13 02:31:00 +00:00
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
|
|
```html
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
|
<h3 class="text-primary text-center">jQuery Playground</h3>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-xs-6">
|
|
|
|
|
<div class="well">
|
|
|
|
|
<button></button>
|
|
|
|
|
<button></button>
|
|
|
|
|
<button></button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-6">
|
|
|
|
|
<div class="well">
|
|
|
|
|
<button></button>
|
|
|
|
|
<button></button>
|
|
|
|
|
<button></button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
```
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --solutions--
|
2020-08-13 15:24:35 +00:00
|
|
|
|
|
2021-01-13 02:31:00 +00:00
|
|
|
|
```html
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
|
<h3 class="text-primary text-center">jQuery Playground</h3>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-xs-6">
|
|
|
|
|
<div class="well">
|
|
|
|
|
<button class="btn btn-default"></button>
|
|
|
|
|
<button class="btn btn-default"></button>
|
|
|
|
|
<button class="btn btn-default"></button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-6">
|
|
|
|
|
<div class="well">
|
|
|
|
|
<button class="btn btn-default"></button>
|
|
|
|
|
<button class="btn btn-default"></button>
|
|
|
|
|
<button class="btn btn-default"></button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
```
|