下面是一个CSS外部样式的示例:
1. 创建一个CSS文件,例如`styles.css`,并在其中定义样式规则:
```css/ styles.css /body { fontfamily: Arial, sansserif; backgroundcolor: f4f4f4;}
header { backgroundcolor: 333; color: fff; padding: 10px 0;}
nav ul { liststyletype: none; margin: 0; padding: 0;}
nav ul li { display: inline; marginright: 10px;}
nav a { textdecoration: none; color: fff;}
nav a:hover { textdecoration: underline;}
footer { backgroundcolor: 333; color: fff; textalign: center; padding: 10px 0; position: absolute; bottom: 0; width: 100%;}```
```html External CSS Example My Website Home About Contact
Welcome to my website!
Copyright