错误1,认为行内元素设置width无效,以为img就是inline-block元素

 查看w3c后发现width 的适用对象是

all elements but non-replaced inline elements, table rows, and row groups

适用于除了非替换行内元素,table rows(tr), row groups(tbody)所有元素


错误2. 关于img,object vedio textarea input 等替换内联元素

    img,object,vedio display 值为 inline

    input button textarea 为inline-block元素


    img假设宽度高度为200*100,这时只设置宽度为100px ,高度会自动缩放到50px

错误3. 关于width 属性百分比,一直理解为是父元素,不准确

    正确理解是该元素的包含块的宽度作为基准,position relative 和 static对应的包含块为content box,而position absolute 包含块计算的是padding box