0

こんにちは、私は Web 開発に比較的慣れていないので、これをクラスで機能させようとしています。目標は、埋め込まれた css クラスを使用して、太字と斜体の両方のフォントを作成することです。これまでのところ、私はこれを持っています:

<!DOCTYPE html><!--Chapter 3 ex 4, a demonstration of class-->
<html lang="en"><!--opens html and sets language to english-->
<head><!--opens head-->
<title>Chapter 3 ex 4</title><!--sets the title of the page-->
<style><!--opens embedded style-->
.new 
{   
font-weight: bold;<!--creates a class new-->
font-style: italic; <!--that is both bold and italic--> 
}
</style> <!--closes embedded style-->
<meta charset="utf-8">
</head> <!--Closes head-->
<body>
<p class="new">Test of new class</p>
</body>
</html>

問題は、テキストが「新しい」クラスの影響をまったく受けていないことです。タグから lang="en" を削除すると、フォント テキストが太字になることがわかりました。これを修正するために私にできることはありますか?

4

3 に答える 3