css 隐藏视觉HTML5 BP样式

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css 隐藏视觉HTML5 BP样式相关的知识,希望对你有一定的参考价值。

// Accessibly hide things

/* Hide only visually, but have it available for screenreaders: h5bp.com/v */

.visuallyhidden(){ 
	border: 0; 
	clip: rect(0 0 0 0); 
	height: 1px; 
	margin: -1px; 
	overflow: hidden; 
	padding: 0; 
	position: absolute; 
	width: 1px; 
}

.visuallyhidden(@focusable) when (@focusable){ 
	border: 0; 
	clip: rect(0 0 0 0); 
	height: 1px; 
	margin: -1px; 
	overflow: hidden; 
	padding: 0; 
	position: absolute; 
	width: 1px; 
    &:active,
    &:focus {
        clip: auto; 
		height: auto; 
		margin: 0; 
		overflow: visible; 
		position: static; 
		width: auto; 
    }
}
	
	/* Hide only visually, but have it available for screenreaders: h5bp.com/v */
	.visuallyhidden { 
		border: 0; 
		clip: rect(0 0 0 0); 
		height: 1px; 
		margin: -1px; 
		overflow: hidden; 
		padding: 0; 
		position: absolute; 
		width: 1px; 
	}

	/* Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: h5bp.com/p */
	.visuallyhidden.focusable:active, 
	.visuallyhidden.focusable:focus { 
		clip: auto; 
		height: auto; 
		margin: 0; 
		overflow: visible; 
		position: static; 
		width: auto; 
		
	}

以上是关于css 隐藏视觉HTML5 BP样式的主要内容,如果未能解决你的问题,请参考以下文章

怎么用CSS给html加横向滚动条并且隐藏竖向滚动条

css css视觉隐藏

怎么用CSS给html加横向滚动条并且隐藏竖向滚动条

css 视觉隐藏2017年

css 视觉隐藏

CSS 样式表HTML5响应式网页设计视频教程