如何更改css访问的字体大小? [英] How to change font size in css visited?

查看:48
本文介绍了如何更改css访问的字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我需要更改所访问链接的字体大小.

  a:visited {颜色:粉红色;font-size:12px;} 

但是只有颜色在改变.为什么字体大小没有变化?

解决方案

的限制:已访问

:visited 伪选择器具有

可接受的属性

如上所示,可以定位的唯一可接受的样式是:

  • 颜色
  • 背景色
  • 边框颜色
  • border- {bottom,left,right,top}-颜色
  • 轮廓颜色
  • 列规则颜色

这样做是出于安全/隐私原因,不太可能很快改变.如果确实要实现此功能,则可能需要使用一些Javascript来显式设置访问的标记的大小.

In my application I need to change the font size of the links that are visited. What I'm doing is

a:visited { 
    color: pink;
    font-size:12px;
}

But only the color is getting changed. Why is the font size not changing ?

解决方案

Limitations of :visited

The :visited pseudoselector has some limitations with regards to what properties it can target and sadly font-size isn't one of them :

Acceptable Properties

As seen above, the only acceptable styles that can be targeted are :

  • color
  • background-color
  • border-color
  • border-{bottom,left,right,top}-color
  • outline-color
  • column-rule-color

This is done for security/privacy reasons and isn't likely going to change any time soon. If you really had to implement this, you would likely need to resort to some Javascript to explicitly set the size on your visited tags.

这篇关于如何更改css访问的字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆