2018-10-10 18:03:03 -04:00
|
|
|
|
---
|
|
|
|
|
|
id: bad87fee1348bd9aec908850
|
|
|
|
|
|
title: Apply the Default Bootstrap Button Style
|
|
|
|
|
|
challengeType: 0
|
2020-09-07 16:17:39 +08:00
|
|
|
|
forumTopicId: 16657
|
|
|
|
|
|
localeTitle: 给 Bootstrap 按钮添加默认样式
|
2018-10-10 18:03:03 -04:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## Description
|
2020-09-07 16:17:39 +08:00
|
|
|
|
<section id='description'>
|
|
|
|
|
|
Bootstrap 还有另外一种属于按钮的 class 属性叫做 <code>btn-default</code>。
|
|
|
|
|
|
为 <code>button</code> 元素增加两个 class: <code>btn</code> 和 <code>btn-default</code>。
|
|
|
|
|
|
</section>
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
|
|
|
## Instructions
|
2020-09-07 16:17:39 +08:00
|
|
|
|
<section id='instructions'>
|
|
|
|
|
|
|
2018-10-10 18:03:03 -04:00
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
|
|
|
|
```yml
|
|
|
|
|
|
tests:
|
2020-09-07 16:17:39 +08:00
|
|
|
|
- text: 将 <code>btn</code> class 添加到所有的 <code>button</code> 元素中。
|
2020-02-18 01:40:55 +09:00
|
|
|
|
testString: assert($(".btn").length > 5);
|
2020-09-07 16:17:39 +08:00
|
|
|
|
- text: 将 <code>btn-default</code> class 添加到每一个 <code>button</code> 元素中。
|
2020-02-18 01:40:55 +09:00
|
|
|
|
testString: assert($(".btn-default").length > 5);
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
|
|
|
|
<div id='html-seed'>
|
|
|
|
|
|
|
|
|
|
|
|
```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>
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
2020-09-07 16:17:39 +08: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>
|
2018-10-10 18:03:03 -04:00
|
|
|
|
```
|
2020-08-13 17:24:35 +02:00
|
|
|
|
|
2020-09-07 16:17:39 +08:00
|
|
|
|
</section>
|