css链接样式的写法<link

html-css05

css链接样式的写法<link,第1张

a:link { text-decoration: none}

a:visited { text-decoration: none}

a:hover { text-decoration: underline}

a:active { text-decoration: underline}

注意:在 CSS 定义中,a:hover 必须位于 a:link 和 a:visited 之后才能生效,a:active 必须位于 a:hover 之后才能生效。

CSS链入式就是在外部文件中写好CSS,通过link标签在页面中直接引入。也就是相当于将页面中的style标签中的样式独立保存为单独的文件。使用<link href='css路径' type='text/css' rel='stylesheet'>引入到页面。