在BFC布局规则中提到内部Box垂直方向距离由margin决定,属于同一个BFC的两个相邻Box的margin会发生重叠。 总结出margin重叠三个条件 1、属于同一个BFC 2、相邻的Box 3、块级元素 常见margin重叠的两种方式: <!DOCTYPE html> <html> <head ...
分类:
其他好文 时间:
2020-07-28 00:01:01
阅读次数:
82
window.innerHeight Chrome浏览器 IE8 下面代码适用所有浏览器 var w = window.innerWidth || document.documentElement.clientWidth ;var w = window.innerHeight || document ...
1.list和str类型相互转化nums=[‘1‘,‘2‘,‘3‘,‘4‘,‘5‘,‘6‘,‘7‘]str_nums="".join(nums)print(type(str_nums))print(str_nums)需要注意的是,该方法需要list中的元素为字符型,若是(数字),则不能使用如上的方法,会产生相应的错误:nums=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,1
分类:
编程语言 时间:
2020-07-27 10:03:10
阅读次数:
98
Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? InputThe first line of input contains N, the number ...
分类:
其他好文 时间:
2020-07-27 09:42:59
阅读次数:
80
其实join函数就是字符串的函数,参数和插入的都要是字符串 所以:将s = '_'.join(args)变成s = '_'.join(str(args).strip()) ...
分类:
编程语言 时间:
2020-07-26 22:53:44
阅读次数:
72
如果需要对关联查询(inner join)做分组(group by),并且按照关联表(actor)中的某个列进行分组,那么通常采用关联表(actor)的标识列(actor_id)分组的效率比其他列更高: select actor.first_name,actor.last_name,count(*) ...
分类:
数据库 时间:
2020-07-26 19:33:13
阅读次数:
88
链接:https://leetcode-cn.com/problems/path-sum/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode ...
分类:
其他好文 时间:
2020-07-26 19:00:19
阅读次数:
52
题目:传送门 方法一、递归 中序遍历:先遍历左子树,在遍历根节点,最后遍历右子树。比较经典的方法是递归。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeN ...
分类:
其他好文 时间:
2020-07-26 15:32:51
阅读次数:
67
去掉input输入框右侧的箭头 在项目中不需要这个箭头直接手动输入 input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; } input[type="number" ...
分类:
其他好文 时间:
2020-07-26 15:10:54
阅读次数:
71
快速排序的核心是先找到一个比较的基数,然后从左往右寻找比基数大的值,从右往左找到比基数小的值,最后交换数据 public static void quickSort(int left,int right,int[]arr){ // 获取最左边的索引和最右边的索引 int l=left; int r= ...
分类:
编程语言 时间:
2020-07-26 11:17:03
阅读次数:
91