使用EMMET中的小坑

时间:2023-05-05 22:54:40
使用EMMET中的小坑

使用EMMET写HTML的时候,是一个非常爽的事情。但是今天我使用时,发现一个小坑。以前倒也没有注意,不过需要非常的小心。

form[action="/process" method ="POST"]>input

执行之后的效果:

<form action="/process" method="" ="POST"><input type="text"></form>

奇怪,怎么method自动增加了一个“”。仔细观察一下:

使用EMMET中的小坑

在"method"的后面有一个空格。去掉,立刻就正常了。

那如果空格不再【】之内的属性中,在>、^、 .关键字之前后呢?

1.在>关键字之前

form[action="/process" mesthod="POST"] >input

使用EMMET中的小坑

2.在>关键字之后

form[action="/process" mesthod="POST"]> input

使用EMMET中的小坑

. 与^关键字类似。

那代码的最后的有空格呢?

form[action="/process" mesthod="POST"]>input  不会自动转换

还有些小情况,大家可以自己分享一下,提高编码的效率。