Web 开发问题汇总(四)
1.如何实现如下布局:两个元素A和B,其中A的宽度为包裹其内容,B则占用剩余的宽度?
A:A 元素利用 float 的包裹性,B 元素则利用 BFC。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Reference:Expand a div to fill the remaining width
2.Meaning of ~ in import of scss files
A:
From documentation on a
sass-loader#imports
project,webpack provides an advanced mechanism to resolve files. The sass-loader uses node-sass' custom importer feature to pass all queries to the webpack resolving engine. Thus you can import your Sass modules from node_modules. Just prepend them with a ~ to tell webpack that this is not a relative import
So if you have a file named foo.css and a module foo then you would use ~ if you want to include the module.
Reference:Meaning of ~ in import of scss files
继续阅读