全栈博客园 全栈博客园全栈博客园

css外部款式,```html External CSS Example My Website Home About Contact

下面是一个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

未经允许不得转载:全栈博客园 » css外部款式,```html External CSS Example My Website Home About Contact