CSS differing link styling

泪湿孤枕 提交于 2019-12-10 19:31:37

问题


From what I know using something like:

.class a {}

Is the same as using:

.class a:link {}

Right?

Additionally..... are the following two styles the same?

.class a:focus {}
.class a:hover {}

Lastly..... the following styling is the color it is when the mouse is down right?

.class a:active {}

回答1:


  • a is every anchor element.
  • a:link is only when the hyperlink has never been visited.
  • a:focus is when you're tabbing through the page with a keyboard.
  • a:hover is when your mouse is over the link.
  • a:active is when you mousedown the link.
  • a:visited is when you've already visited that link.



回答2:


  • :link = Only links you haven't already visited
  • :visited = Links you have already visited
  • :focus = For elements in focus, like when you use the tabulator
  • :hover = When you move your mouse over it
  • :active = for just clicked links


来源:https://stackoverflow.com/questions/4629923/css-differing-link-styling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!