×
CSS 参考手册CSS 选择器CSS 听觉参考手册CSS Web安全字体组合CSS 动画CSS 单位CSS 颜色CSS 合法颜色值CSS 颜色名称CSS 颜色十六进制值CSS 浏览器支持

CSS 属性

align-contentalign-itemsalign-selfallanimation(动画)animation-delayanimation-directionanimation-durationanimation-fill-modeanimation-iteration-countanimation-nameanimation-play-stateanimation-timing-functionappearancebackface-visibilitybackgroundbackground-attachmentbackground-blend-modebackground-clipbackground-colorbackground-imagebackground-originbackground-positionbackground-repeatbackground-sizeborderborder-bottomborder-bottom-colorborder-bottom-left-radiusborder-bottom-right-radiusborder-bottom-styleborder-bottom-widthborder-collapseborder-colorborder-imageborder-image-outsetborder-image-repeatborder-image-sliceborder-image-sourceborder-image-widthborder-leftborder-left-colorborder-left-styleborder-left-widthborder-radiusborder-rightborder-right-colorborder-right-styleborder-right-widthborder-spacingborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottombox-alignbox-directionbox-flexbox-flex-groupbox-linesbox-ordinal-groupbox-orientbox-packbox-shadowbox-sizingcaption-sideclearclipcolorcolumn-countcolumn-fillcolumn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnscontentcounter-incrementcounter-resetcursordirectiondisplayempty-cellsfilter(滤镜)flexflex-basisflex-directionflex-flowflex-growflex-shrinkflex-wrapfloatfont@font-facefont-familyfont-sizefont-size-adjustfont-stretchfont-stylefont-variantfont-weightgrid-columnsgrid-rowshanging-punctuationheighticonjustify-content@keyframesleftletter-spacingline-heightlist-stylelist-style-imagelist-style-positionlist-style-typemarginmargin-bottommargin-leftmargin-rightmargin-topmax-heightmax-width@mediamin-heightmin-widthnav-downnav-indexnav-leftnav-rightnav-upopacityorderoutlineoutline-coloroutline-offsetoutline-styleoutline-widthoverflowoverflow-xoverflow-ypaddingpadding-bottompadding-leftpadding-rightpadding-toppage-break-afterpage-break-beforepage-break-insideperspectiveperspective-originpositionpunctuation-trimquotesresizerightrotationtab-sizetable-layouttargettarget-nametarget-newtarget-positiontext-aligntext-align-lasttext-decorationtext-decoration-colortext-decoration-linetext-decoration-styletext-indenttext-justifytext-outlinetext-overflowtext-shadowtext-transformtext-wraptoptransformtransform-origintransform-styletransitiontransition-delaytransition-durationtransition-propertytransition-timing-functionunicode-bidivertical-alignvisibilitywhite-spacewidthword-breakword-spacingword-wrapz-indexwriting-mode

CSS :hover 选择器


CSS 选择器CSS 选择器


实例

选择鼠标移到链接上的样式:

a:hover
{
background-color:yellow;
}

尝试一下 »

定义和用法

:hover在鼠标移到链接上时添加的特殊样式。

提示: :hover 选择器器可用于所有元素,不仅是链接。

提示: :link 选择器设置了未访问过的页面链接样式, :visited 选择器设置访问过的页面链接的样式 :active选择器设置当你点击链接时的样式。

注意: 为了产生预期的效果,在 CSS 定义中,:hover 必须位于 :link 和 :visited 之后!!


浏览器支持

表格中的数字表示支持该属性的第一个浏览器版本号。

选择器
:hover 4.0 7.0 2.0 3.1 9.6

注意:在 IE 中必须声明 <!DOCTYPE> 才能保证 :hover 选择器能够有效。


相关页面

CSS 教程: CSS Links

CSS 教程: CSS 伪类


Examples

Try it Yourself - Examples


实例

激活的、已访问的、未访问的或者当有鼠标悬停在其上的链接:

a:link    {color:green;}
a:visited {color:green;}
a:hover   {color:red;}
a:active  {color:yellow;}

尝试一下 »

实例

不同样式的链接样式:

a.ex1:hover,a.ex1:active {color:red;}
a.ex2:hover,a.ex2:active {font-size:150%;}

尝试一下 »

CSS 选择器CSS 选择器


分类导航

关注微信下载离线手册

bootwiki移动版 bootwiki
(群号:472910771)