FAQ问答列表HTML+CSS
时间: 2023-06-28 14:08:23 浏览: 194
HTML+CSS面试题及答案
以下是一个简单的FAQ问答列表的HTML+CSS示例:
HTML代码:
```
<div class="faq-list">
<h2>Frequently Asked Questions</h2>
<ul>
<li>
<h3>What is your return policy?</h3>
<p>We offer a 30-day money-back guarantee on all products.</p>
</li>
<li>
<h3>How long does shipping take?</h3>
<p>Shipping typically takes 3-5 business days.</p>
</li>
<li>
<h3>Do you offer international shipping?</h3>
<p>Yes, we offer international shipping to most countries.</p>
</li>
<li>
<h3>What forms of payment do you accept?</h3>
<p>We accept all major credit cards and PayPal.</p>
</li>
</ul>
</div>
```
CSS代码:
```
.faq-list {
max-width: 600px;
margin: 0 auto;
padding: 20px 40px;
}
h2 {
text-align: center;
font-size: 28px;
margin-bottom: 40px;
}
ul {
list-style: none;
padding: 0;
}
li {
margin-bottom: 40px;
}
h3 {
font-size: 20px;
margin-bottom: 20px;
}
p {
font-size: 16px;
line-height: 1.5;
}
```
这个示例使用了一个包含四个QA对的无序列表。每个QA对都有一个标题和一个段落。CSS代码定义了FAQ列表的样式,包括标题和段落的大小和间距,以及列表的样式。
阅读全文