CSS class starting with number is not getting applied

前端 未结 4 1643
死守一世寂寞
死守一世寂寞 2020-12-20 07:19

I\'m trying to create a webpage that contains images. However, I want all the images to be the same size and in the same format. I have the following CSS class which applies

4条回答
  •  Happy的楠姐
    2020-12-20 08:07

    CSS class names should not begin with a number (unless you're willing to do what @torazaburo's answer describes). So perhaps change that, i.e. the class name from "200-200" to "s200-200".

    .200 {
      color: red;
    }
    .s200 {
      color: red;
    }
    I'm not red :(
    I am red :)

提交回复
热议问题