在 HTML 和 CSS 中使用这个方法通过创建一个 class="pro" 来使用有什么区别。
<p>a <u>pro</u>grammar</p>
Run Code Online (Sandbox Code Playgroud)
在 HTML 中?
HTML 使用类...
<p>a <span class="pro">pro</span>programmer.</p>
Run Code Online (Sandbox Code Playgroud)
CSS类
.pro {text-decoration: underline;}
Run Code Online (Sandbox Code Playgroud)
结果是一样的,但我想知道是否有理由为什么我应该使用一个而不是另一个。