CSS/HTML: What is the correct way to make text italic?

后端 未结 12 1892
死守一世寂寞
死守一世寂寞 2020-12-02 06:46

What is the correct way to make text italic? I have seen the following four approaches:

Italic Text

I         


        
12条回答
  •  渐次进展
    2020-12-02 07:21

    DO

    1. Give the class attribute a value indicating the nature of the data (i.e. class="footnote" is good)

    2. Create a CSS style sheet for the page

    3. Define a CSS style that is attached to the class that you assign to the element

      .footnote { font-style:italic; }

    DO NOT

    1. Don't use or elements - they're unsupported and ties the data and presentation too close.
    2. Don't give the class a value that indicates the presentation rules (i.e. don't use class="italic").

提交回复
热议问题