这种"背景位置"线是否含糊不清?

aja*_*221 2 html css background-position

刚才读你是不是允许混合值,例如:background-position: top 50%;

但是,我不确定以下几行是否含糊不清:

background-position: 0 50%; //can the 0 be confused as 0px?
background-position: 0 50px; //can the 0 be confused as 0%?
Run Code Online (Sandbox Code Playgroud)

我担心的是,它们可能以禁止的方式凝聚并导致意外的错误.

你认为这会发生吗?是什么让你这么想?

McG*_*gle 6

0px和0%是相同的.就像在物理学中一样 - 没有单位为零,说0cm或0in是没有意义的,它只是没有.

  • 绝对不是,这就是我要说的.:-) (3认同)