qq_风信子_26
2017-11-02 22:33
颜色好像看不到显示效果和具中
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Html和CSS的关系</title>
<style type="text/css">
h1{
font-size:12px;
color:red;
text-align:center;
background-color:blue;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
加了一个背景颜色为蓝色background-color:blue;
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Html和CSS的关系</title> <style type="text/css"> h1{ display:block; font-size:12px; color:red; text-align:center; } </style> </head> <body> <h1>Hello World!</h1> </body> </html> color是字体颜色,背景颜色是background,或者把h1标签设置成块元素试试,在css里面加上display:block;
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Html和CSS的关系</title> <style type="text/css"> h1{ font-size:12px; color:#930; text-align:center; } </style> </head> <body> <h1>Hello World!</h1> </body> </html>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Html和CSS的关系</title>
<style type="text/css">
h1{
font-size:12px;
color:red;
text-align:center;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
初识HTML(5)+CSS(3)-升级版
1225309 学习 · 18230 问题
相似问题