下面是一个简单的百度百科CSS样式表示例:
“`css
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
header {
background-color: #4CAF50;
color: white;
padding: 20px;
text-align: center;
nav {
background-color: #fff;
border-radius: 5px;
padding: 10px;
nav ul {
list-style: none;
margin: 0;
nav ul li {
display: inline-block;
margin-right: 10px;
nav a {
color: white;
text-decoration: none;
padding: 10px 20px;
nav a:hover {
background-color: #3e8e41;
section {
margin: 50px auto;
max-width: 960px;
text-align: center;
section h1 {
font-size: 36px;
margin-bottom: 20px;
section p {
font-size: 18px;
line-height: 1.6;
margin-bottom: 30px;
footer {
background-color: #4CAF50;
color: white;
padding: 20px;
text-align: center;
接下来,大家使用`section`元素来定义页面中的各个部分,其中`h1`元素来定义页面的头部标题,`p`元素来定义页面的正文内容。最后,大家使用`footer`元素来定义页面的结尾区域,其中`background-color`属性为白色,`color`属性为黑色,`padding`属性为20px,`text-align`属性为center。
通过使用这些CSS样式表,大家可以控制整个页面的布局和外观,使得页面更加美观和舒适。大家可以使用CSS的变换功能来调整页面的样式,例如使用`margin`和`padding`属性来移动元素,使用`top`和`bottom`属性来设置元素的上下限,使用`transform`属性来旋转元素等。
总之,CSS可以帮助大家调换页面的布局,使得整个页面看起来更加美观和舒适。通过使用CSS,大家可以控制网页的样式、布局和外观,使得网页更加易于使用和浏览。