This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
对一个数组进行排序:要求奇数在前偶数在后,奇数从大到小排列,偶数从小到大排列。 | |
如:var arr = [13,4,2,3,8,5,6,7]; -> arr = [13,7,5,3,2,4,6,8]; | |
输入一个自然数 n,输出所有可能和为 n 连续正数序列。 | |
例如输入15,由于1+2+3+4+5=4+5+6=7+8=15, | |
所以输出 3 个连续序列1,2,3,4,5、4,5,6 和7,8。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
输入一个自然数 n,输出所有可能和为 n 连续正数序列。 | |
例如输入15,由于1+2+3+4+5=4+5+6=7+8=15, | |
所以输出 3 个连续序列1,2,3,4,5、4,5,6 和7,8。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
用代码实现函数B继承函数A里边的全部属性与方法,且覆盖函数A其中的sayName方法。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
求一个字符串的字节长度; | |
//假设一个中文占两个字节 | |
/*var str = 'hello中国'; | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
如何把一个字符串,用特定的符号有序的连接,列出所有连接可能。 | |
如:'ab' -> a-b, | |
'abc' -> a-bc, a-b-c, ab-c, | |
'abcd' -> a-bcd, ab-cd, abc-d,a-b-cd, ab-c-d,a-bc-d,a-b-c-d | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
用正则怎样去除重复的字符串,只保留未重复的。 | |
如:var str= "aaabbbcccddde"; | |
结果为 abcde。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
解释以下选择器的区别: | |
1. body 与 .body | |
2. .main .sub 与 (.main, .sub) | |
3. .main > .sub 与 .main .sub | |
4. .main + .sub 与 .main .sub | |
5. .main + .sub 与 .main > .sub | |
6. [abc^="def"] 与 [abc$="def"] 与 [abc*="def"] 与 [abc^="def"] 与 [abc|="def"] 与 [abc~="def"] | |
7. p:first-child 与 ::first-line | |
8. * 与 (.main *) | |
9. :nth-child 与 :nth-last-child 与 :nth-of-type 与 :last-child 与 :first-of-type 与 :empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 如何使容器透明,内容不透明? | |
分别用1个div或2个div的2种方式实现这个效果。 | |
2. style, !important, id, class, 标签, *(通配符)他们的权重顺序是怎么样的? | |
3. link 与 @import 的区别? | |
4. position: relative、absolute、fixed、static、inherit的区别? | |
5. display: inline,block,inline-block,list-item,inline-table,table-cell的区别? | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
用html,css实现以下三种情况的布局: | |
1. 2列布局:左固定,右自适应。 | |
2. 3列布局:左右固定,中自适应。 | |
3. 2行上下布局,下是左右布局: | |
a. 头部高固定且位置固定, | |
b. 下左宽度固定,下右宽度自适应且实现iframe高度自适应, | |
c. 全屏无横向滚动条,下左,下右内容超出高度时出现纵向滚动条 (可以不考虑ie6,用纯css实现)。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 如何居中一个浮动元素? | |
2. 如何使一个position:fixed的元素居于定宽居中div的右侧, | |
且随着窗口大小变化而位置不变? | |
3. 如何居中一个psoition:absolute元素? | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```html | |
// you code | |
``` |