Should css class names like 'floatleft' that directly describe the attached style be avoided?

后端 未结 20 2107
谎友^
谎友^ 2020-12-13 08:32

Lots of websites use class names like floatleft, clearfloat, alignright, small, center etc that describe the

20条回答
  •  天涯浪人
    2020-12-13 09:12

    You are saying something like this:

    .red
    {
        color:red;
    }
    

    so in order to use this class:

    • hello

    ALTERNATIVE SOLUTION

    ul li
    {
        color:red;
    }
    

    Usage:

    • Hello

    By this you can actually remove the presentation information from the content.

提交回复
热议问题