Are there any CSS standards that I should follow while writing my first stylesheet?

前端 未结 17 649
有刺的猬
有刺的猬 2020-12-13 02:40

I am currently working on my first website. I have no idea where to start on the CSS page, or if there are any standards that I should be following.

I would appreci

17条回答
  •  我在风中等你
    2020-12-13 03:32

    An error that beginners make quite often:

    CSS is semantic as well. Try to express concepts, not formats. Contrived example:

    Wrong:

    div.red
    {
        color: red;
    }
    

    as opposed to:

    Good:

    div.error
    {
        color: red;
    }
    

    CSS should be the formatting companion for the concepts you use on your web site, so they should be reflected in it. You will be much more flexible this way.

提交回复
热议问题