级联样式表(CSS)网页样式设计指南
1. 引言
在网页设计中,级联样式表(CSS)起着至关重要的作用,它能够让网页更加美观和专业。本文将介绍一些CSS的基本样式设置以及CSS1和CSS2的相关属性。
2. 基本样式设置示例
以下是一个简单的CSS样式设置示例,用于创建一个带有菜单的网页,并且菜单的子菜单在鼠标悬停时显示:
body { background-color: lightblue;font-size: x-large; }
/* the background is lightblue with extra large fonts */
#menu { background-color:blue;float:left; }
/* the menu has a blue background and is floated to the left hand side */
#menu li { font-size: x-large; color: yellow; }
/* the list items in the menu are in a large yellow font */
#menu li:hover { color:red; }
/* list items change to red when the mouse passes over*/
#menu li a { color:lime; }
/* the links are lime colored */
#menu li a:hover { color:red; background-color: white; }
/* th
超级会员免费看
订阅专栏 解锁全文
15

被折叠的 条评论
为什么被折叠?



