用css 如果定义有链接的字体大

html-css011

用css 如果定义有链接的字体大,第1张

.news a:link{ color:#000text-decoration: nonefont-size:12px }

.news a:visited {text-decoration: nonecolor:#000}

.news a:hover {color:#F00

.news a:active {text-decoration: nonecolor:#000}

其中第一行的link中font-size:12px就是字体的大小。这样你在要使用的地方调用class="news"就可以了,如果你想所有的连接都统一样式,那好办,把上面的.news去掉,

a:link{ color:#000text-decoration: nonefont-size:12px }

a:visited {text-decoration: nonecolor:#000}

a:hover {color:#F00

a:active {text-decoration: nonecolor:#000}

完整的代码是

<style type="text/css">

a:link{ color:#000text-decoration: nonefont-size:12px }

a:visited {text-decoration: nonecolor:#000}

a:hover {color:#F00

a:active {text-decoration: nonecolor:#000}

</style>

放在<head></head>标签之间

后台链接是放在input标签里?

如果input有maxlength,先去掉该属性

如果要给a添加宽度,现将其转化为块元素 display:block 再定义width