嗨我在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