V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  rabbbit  ›  全部回复第 86 页 / 共 115 页
回复总数  2287
1 ... 82  83  84  85  86  87  88  89  90  91 ... 115  
2018-11-27 14:16:48 +08:00
回复了 CoderOnePolo 创建的主题 推广 五分钟学会一个有意思的排序:计数排序
这个动画不错,哪啥做的
2018-11-27 13:12:08 +08:00
回复了 des 创建的主题 Node.js npm 后门仓库被发现
2018-11-27 12:38:50 +08:00
回复了 saran 创建的主题 问与答 如何把闲置的旧手机改造成监控器呐?
加个锥子,发现有贼自动戳破电池引发爆炸?
2018-11-27 11:56:47 +08:00
回复了 itingyuji 创建的主题 求职 辞职走佬,求大佬带
2018-11-27 11:55:38 +08:00
回复了 itingyuji 创建的主题 求职 辞职走佬,求大佬带
@blackshow
1 形成新的 bfc
block 元素高度计算不包括 float 子元素

具体见 CSS2.1 10.6.3
Only children in the normal flow are taken into account (i.e., floating boxes and absolutely positioned boxes are ignored, and relatively positioned boxes are considered without their offset).
只考虑常规流中的子级(即,浮动盒和绝对定位的盒会被忽略,并且相对定位的盒不考虑其偏移)

添加 overflow: hidden 后,会创建一个新的 block formatting context(块格式化上下文)

具体见 CSS2.1 9.4
Floats, absolutely positioned elements, block containers (such as inline-blocks, table-cells, and table-captions) that are not block boxes, and block boxes with 'overflow' other than 'visible' (except when that value has been propagated to the viewport) establish new block formatting contexts for their contents.
浮动,绝对定位的元素,非块盒的块容器(例如 inline-blocks,table-cells 和 table-captions ),以及’ overflow ’不为’ visible ’的块盒(当该值已被传播到视口时除外( except when that value has been propagated to the viewport ))会为其内容建立新的块格式化上下文

而块级上下文高度包括 float 子元素
具体见 CSS2.1 10.6.7
In addition, if the element has any floating descendants whose bottom margin edge is below the element's bottom content edge, then the height is increased to include those edges.
此外,如果该元素含有任意下外边距边界位于元素的内容下边界下方的的浮动后代,那么高度增加至能够包含这些边界。

2 相对于父元素 width 计算

见 CSS2.1 8.4
The percentage is calculated with respect to the width of the generated box's containing block, even for 'padding-top' and 'padding-bottom'.
百分比根据生成盒的包含块的 width 来计算,即使是'padding-top'和'padding-bottom'。
CSS 8.3
The percentage is calculated with respect to the width of the generated box's containing block. Note that this is true for 'margin-top' and 'margin-bottom' as well.
百分比根据生成盒的包含块的 width 来计算。注意,这一点对于'margin-top'和'margin-bottom'也适用。

3
都相对于 font-size 计算
对于元素自身来说没区别,但对于内部的子元素有区别
数值直接被继承,1 就是 1.百分比值继承的是百分比*font-size 计算后的结果

具体见 CSS2.1 10.8.1
<number>
The specified length is used in the calculation of the line box height.
该属性的应用值为这个数字乘以该元素的字体大小。
<percentage>
The used value of the property is this number multiplied by the element's font size.
该属性的计算值为这个百分比乘以该元素的字体大小的计算值。

4
inline 元素默认对齐基线,也就是 vertical-align: baseline
而 inline-block 里没内容时对齐元素底部,也就是图片坐在了基线上
解决办法是 vertical-align: non baseline,例如 vartical-align: top,或者给容器加上 font-size: 0

具体见 CSS 2.1 10.8.1
baseline
Align the baseline of the box with the baseline of the parent box. If the box does not have a baseline, align the bottom margin edge with the parent's baseline.
把盒的基线与父级盒的基线对齐。如果该盒没有基线,就把下外边距边界和父级的基线对齐

若有错误请指正
2018-11-26 13:14:27 +08:00
回复了 itingyuji 创建的主题 求职 辞职走佬,求大佬带
很多时候,学太杂了会觉得什么都会,其实什么都不会
拿 CSS 来说,想想看这些基本知识能不能答出来

overflow: hidden 清除浮动的原理是什么?
padding-top 和 margin-top 的百分比值相对于谁计算?
line-height 的数字值(1)和百分比值(100%)有什么区别,相对于谁计算?
经常能看到 img 下面有一个空隙,为什么会产生空隙,如何解决?
2018-11-25 23:11:14 +08:00
回复了 rabbbit 创建的主题 分享创造 [GoldenDict]AutoHotKey 划词翻译脚本
@Aura7988 AutoHotKey 只有 windows 版本,Mac 用不了
2018-11-25 21:30:17 +08:00
回复了 picturepan2 创建的主题 分享创造 纯 CSS 实现的 360 度产品查看器
原理就是给滑动条绑了个 input 事件,修改背景坐标
把那个 input 事件删了就动不了了
https://i.imgur.com/yfMJVIj.gif
2018-11-25 18:48:15 +08:00
回复了 rabbbit 创建的主题 分享创造 [GoldenDict]AutoHotKey 划词翻译脚本
@chuanqirenwu GoldenDict 可以自己加字典
2018-11-24 10:59:00 +08:00
回复了 mengxy 创建的主题 酷工作 前端老司机招徒弟
有什么具体要求呢? 例如需要会哪些框架,是否要求有工作经验
function t(str) {
const reg1 = /^([\u0000-\u007F]|[\u4E00-\u9FCC\u3400-\u4DB5\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\ud840-\ud868][\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|[\ud86a-\ud86c][\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d]){0,10}$/;
const reg2 = /[()<>]+/;
if (reg1.test(str) && (!reg2.test(str))) {
return true;
} else {
return false;
}
}

console.log(t('1234567890') === true)
console.log(t('12345678901') === false)
console.log(t('azAZ') === true)
console.log(t('niconiconico') === false)
console.log(t('全') === true)
console.log(t('()') === false)
console.log(t('<>') === false)
console.log(t(`!"#$%&*+,.`) === true)
console.log(t(`𠀐𠀐𠀐𠀐𠀐𠀐𠀐𠀐𠀐𠀐`) === true)
console.log(t(`𠀐𠀐𠀐𠀐𠀐𠀐𠀐𠀐𠀐𠀐𠀐`)=== false)
console.log(t('。') === false)
console.log(t(',') === false)
console.log(t('”') === false)
console.log(t(':') === false)
console.log(t('¥') === false)
console.log(t('『') === false)
2018-11-22 22:55:47 +08:00
回复了 VgV 创建的主题 程序员 有什么办法避免人脸识别 [亮瞎眼]
开个针对程序员的化妆班,说不定有市场...
2018-11-22 19:42:48 +08:00
回复了 shpasspass 创建的主题 问与答 js 里, if(false){}似乎执行了,为什么?
2018-11-22 19:41:12 +08:00
回复了 shpasspass 创建的主题 问与答 js 里, if(false){}似乎执行了,为什么?
js 在进入函数时时会把 var 声明的变量提升到顶部

function 中的所有 var 变量, function 声明的函数, 传进来的参数都会绑定到一个 Environment Record 上
执行函数内部代码前,有一步叫 Declaration Binding Instantiation
http://ecma-international.org/ecma-262/5.1/#sec-10.5
注意步骤 8,遍历代码,把所有 var 参数名绑定到 Environment Record,赋值为 undefined
2018-11-22 10:51:47 +08:00
回复了 skyeycirno 创建的主题 全球工单系统 现在微信解封要识别人脸是什么鬼??
我想知道有没有卖对付这种人脸识别用的"假脸"
2018-11-21 23:26:34 +08:00
回复了 niuxuewei 创建的主题 程序员 关于 hexo 对文章渲染解析{{}}的问题
试试这个,记得装之前备份,因为要卸掉默认的渲染器
https://github.com/CHENXCHEN/hexo-renderer-markdown-it-plus
2018-11-21 16:08:04 +08:00
回复了 xiaohantx 创建的主题 求职 [求职][杭州]专科,一年以下 | WEB 前端
@msputup
抱歉搭下车
大佬能帮忙看下简历,给点意见吗?
https://aaron-bird.github.io/resume/resume.pdf
2018-11-21 15:11:12 +08:00
回复了 xiaohantx 创建的主题 求职 [求职][杭州]专科,一年以下 | WEB 前端
@xiaohantx
还是先干着吧
要是换我,能找找个工作就烧高香了,管他外包还是创业公司
2018-11-21 14:39:01 +08:00
回复了 xiaohantx 创建的主题 求职 [求职][杭州]专科,一年以下 | WEB 前端
@xiaohantx 两家公司就待了两个月是啥情况...
2018-11-21 14:33:29 +08:00
回复了 xiaohantx 创建的主题 求职 [求职][杭州]专科,一年以下 | WEB 前端
现在工作这么难找吗?
1 ... 82  83  84  85  86  87  88  89  90  91 ... 115  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2580 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 39ms · UTC 02:19 · PVG 10:19 · LAX 19:19 · JFK 22:19
Developed with CodeLauncher
♥ Do have faith in what you're doing.