Heim  >  Artikel  >  Datenbank  >  网页技巧收集

网页技巧收集

WBOY
WBOYOriginal
2016-06-07 15:30:091059Durchsuche

.header{ text-indent:-9999px; background:url('someimage.jpg') no-repeat; height: 100px; /*dimensions equal to image size*/ width:500px;} 这是一个很好的SEO技巧,让你看到一个不错的花哨的图像,而不是简单枯燥的文字,但搜索引擎将只能看到文字。

.header{
 text-indent:-9999px;
 background:url('someimage.jpg') no-repeat;
 height: 100px; /*dimensions equal to image size*/
 width:500px;
}

这是一个很好的SEO技巧,让你看到一个不错的花哨的图像,而不是简单枯燥的文字,但搜索引擎将只能看到文字。

不知道这算不算是一个作弊的行为。text-indent为正值意为文本块向右缩进长度,为复制意为文本块向左缩进长度。上面的效果是,将文字移出了浏览器的视野之内,但是搜索引擎会找得到。


#container{
 height:auto !important;/*all browsers except ie6 will respect the !important flag*/
 min-height:500px;
 height:500px;/*Should have the same value as the min height above*/
}

Internet Explorer不理解min-height属性,但这里的CSS技巧来完成,在IE浏览器。跨浏览器的最低高度(让IE支持min-height)


transparent_class {
 filter:alpha(opacity=50);
 -moz-opacity:0.5;
 -khtml-opacity: 0.5;
 opacity: 0.5;
}
虽然CSS3标准包括Opacity属性,但不是每个浏览器都支持它跨浏览器的透明度,这里的CSS技巧。跨浏览器支持不透明度


line-height:30px;
height:30px;
如果您使用的是固定高度容器和垂直居中的文本,使用line-height属性,line-height像素和高度一致,完美地做到这一点。

body{
 width:980px;
 margin:0 auto;
}
让body笃定宽度并且居中。


text-transform: capitalize;
让每个单词的首字母大写。


font-variant:small-caps;
让所有字母都大写。


a img{ border:none; }
图片超链接通常会得到一个丑陋的蓝色边框,使您的图像超链接看起来可怕。下面代码就可去掉。


@font-face {
	font-family: Blackout;
	src: url("assests/blackout.ttf") format("truetype");
}
@font-face 能够加载服务器端的字体文件,让客户端显示客户端所没有安装的字体。

input[type="text"] {
    width: 200px;
}
定义文本框样式。


onerror="javascript:this.src='../indexImages/daex03.jpg'"



在控件的同一行让文字垂直居中

#divSearch input {
vertical-align: middle;
}

js获取url参数的方法

//获取传过来的参数值
    function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
    }





















Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn