时间:2021-07-01 10:21:17 帮助过:48人阅读

代码如下:
<style>
.test{}
.test h1{margin:0; padding:0; text-indent:-9999px; width:522px; height:45px;
background:url(header.gif) no-repeat;}
.testbox{background:url(bg.gif); width:522px; height:323px;}
</style>
<div class="test">
<h1>邀请好友加入</h1>
</div>
<div class="testbox"></div><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>h1标签的使用</title>
<style>
.test{}
.test h1{margin:0; padding:0; text-indent:-9999px; width:522px; height:45px;
background:url(https://www.gxlcms.com/upload/20071124114047865.gif) no-repeat;}
.testbox{background:url(https://www.gxlcms.com/upload/20071124114047678.gif); width:522px; height:323px;}
</style>
</head>
<body>
正确使用h1标签,兼顾美观与seo.
<div class="test">
<h1>邀请好友加入</h1>
</div>
<div class="testbox"></div>
</body>
</html>h1标签还可以这样使用,当然你也可以对h1标签使用样式比如字体大小,字体颜色之类的,当然像上面例子,只是为了达到seo的目的,就不需要使用样式对h1标签进行修改了,因为显示在用户面前的是一张图片。
以上就是h1标签的使用技巧_经验交流的内容,更多相关内容请关注PHP中文网(www.gxlcms.com)!