用html+css 写一个问答的漂亮的页面
<!DOCTYPE html>
<html>
<head>
<title>问答页面</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
}
h1 {
text-align: center;
color: #333;
margin-top: 50px;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 50px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
.question {
margin-bottom: 20px;
padding-bottom: 20px;
border-bottom: 1px solid #ccc;
}
.question h2 {
color: #333;
margin-top: 0;
margin-bottom: 10px;
}
.question p {
color: #666;
margin-top: 0;
margin-bottom: 10px;
}
.answer {
margin-bottom: 20px;
padding-left: 20px;
border-left: 2px solid #ccc;
}
.answer p {
color: #666;
margin-top: 0;
margin-bottom: 10px;
}
</style>
</head>
<body>
<h1>问答页面</h1>
<div class="container">
<div class="question">
<h2>什么是HTML?</h2>
<p>HTML是一种标记语言,用于创建网页。</p>
</div>
<div class="answer">
<p>HTML是Hyper Text Markup Language的缩写,是一种用于创建网页的标记语言。它使用标记来描述网页的结构和内容,包括文本、图像、链接等。HTML标记通常以尖括号包围,如<p>和</p>表示段落。HTML是网页开发的基础,是网页设计师必须掌握的技能之一。</p>
</div>
<div class="question">
<h2>CSS是什么?</h2>
<p>CSS是一种样式表语言,用于控制网页的外观和布局。</p>
</div>
<div class="answer">
<p>CSS是Cascading Style Sheets的缩写,是一种用于控制网页外观和布局的样式表语言。它可以控制文本、颜色、背景、边框、间距、布局等方面的样式。CSS可以使网页更加美观、易于阅读和导航,是网页设计师必须掌握的技能之一。</p>
</div>
</div>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/bJnd 著作权归作者所有。请勿转载和采集!