html<;p>;样式代码不起作用
尝试编写一个简单的网页,我正在学习html。我想知道为什么我的的简单样式代码没有改变。在下面html<;p>;样式代码不起作用,html,css,paragraph,Html,Css,Paragraph,尝试编写一个简单的网页,我正在学习html。我想知道为什么我的的简单样式代码没有改变。在下面 <!DOCTYPE html> <html> <head> <!-- SE copied from old site --> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https:
<!DOCTYPE html>
<html>
<head>
<!-- SE copied from old site -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/
font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/topnav-index.css">
<!-- abv css I created myself, just the TopNav bar -->
<style>
<!-- this is for page wide style -->
<!-- define all paragraph font for main pg -->
p {
color: red;
text-align: left;
font-family: palatino;
font-size: 16pt;
background-color: #909090;
<!-- margin: 4 prop is top, R, bott, L -->
margin-left: 32px;
margin-top: 30px;
<!-- margin: 20,25,35,40; -->
padding-left: 12%;
padding-top: 10%;
}
</style>
</head>
<body>
<div class="topnav" id="myTopnav">
<a href="#home" class="active">Home</a>
<a href="#news">News</a>
<a href="#contact">Contact</a>
<a href="#about">About</a>
<a href="javascript:void(0);" class="icon" onclick="myFunction()">
<i class="fa fa-bars"></i>
</a>
</div>
<div style="padding-left:16px">
<h2>Title</h2>
<p>Responsive Topnav Example</p>
</div>
<!-- main content -->
<p>B This site explores the connection between XXX and the
historical events...</p>
p{
颜色:红色;
文本对齐:左对齐;
字体系列:palatino;
字号:16pt;
背景色:#909090;
左边距:32px;
边缘顶部:30px;
左:12%;
垫面:10%;
}
标题
响应式Topnav示例
本网站探讨了XXX和
历史事件
现在,顶部导航栏可以工作,但p文本的格式似乎没有任何作用。它在标题中&我理解p,在大于/小于符号中,充当它自己的特殊容器…在css中,您应该使用/**/进行评论,而不是
只是一个打字字体家族:palatino;(不是帕兰蒂诺)谢谢,做出了更改,但没有明显的视觉效果。您正在CSS中使用HTML注释。不要使用
使用/*
*/
作为CSS注释
p {
color: red;
text-align: left;
font-family: palatino;
font-size: 16pt;
background-color: #909090;
/* margin: 4 prop is top, R, bott, L */
margin-left: 32px;
margin-top: 30px;
/*margin: 20,25,35,40; */
padding-left: 12%;
padding-top: 10%;
}