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

后端 未结 20 2112
谎友^
谎友^ 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:19

    Style classes should be semantic. This is a great article on semantic web page design (well, I found it really helpful anyway).

    EDIT: I just read another article that makes some good points for using things like display: inline-block, display: table etc. instead of floats. That should help avoid those pesky floatleft and clearfix classes. Making them semantic is always up to you though.

提交回复
热议问题