JSFiddle - React, Tailwind, and code Playground

by zicai

HTML

<!-- 触发haslayout的元素是可以设置宽高的,而触发BFC的元素不一定可以设置宽高 -->
<span id="haslayout" class="span" style="float:left">ahahah</span>

<span id="bfc" class="span" style="overflow:hidden">嘎嘎</span>

CSS

.span {
    height:50px;
    width:50px;
    background:green;
}

JavaScript

//在IE中运行下面代码
//console.log(document.getElementById("haslayout").currentStyle.hasLayout);
//console.log(document.getElementById("bfc").currentStyle.hasLayout);