嗨我在web開發相對較新,我試圖讓這個工作的類。目標是使用嵌入式CSS類來製作粗體和斜體的字體。到目前爲止,我有這個:我是新的與嵌入式css類不與字體樣式和字體重量工作的HTML問題
<!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」,字體文本變爲粗體。任何人有任何想法我可以做什麼來解決這個問題?
非常感謝。這本書沒有很好地解釋這一點。 – user2863558
沒問題。歡迎來到SO – Cfreak