HTML设为首页/加入收藏代码

 

(特别注意:要把这个符号换成无任何输入法状态中输入的这个符号,否则程序无法运行)   
1.文字型:    
<a οnclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.apple-wallpaper.com’);" href="http://www.apple-wallpaper.com">设为首页</a>    


2.按钮型:    
<input TYPE="button" VALUE=" 设为首页 " οnclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.apple-wallpaper.com’);" href="http://www.apple-wallpaper.comt">    

3.离开时自动提示设为首页:    
<body οnunlοad="BASEBody.style.behavior=’url(#default#homepage)’;if(!(BASEBody.isHomePage(’http://www.1.com’)))BASEBody.setHomePage(’http://www.apple-wallpaper.comt’);">  

4.打开网页就提示是否设为主页: 
<script language="javascript">  
function myhomepage(){  
this.homepage.style.behavior=’url(#default#homepage)’;this.homepage.sethomepage(’http://www.dafacai.net’);  
}  
</script>  
<p align="center"><a href="http://www.apple-wallpaper.comt" name="homepage"  
οnclick="myhomepage();"></a>  

 

 

1.图片链接

<a style="cursor:hand" οnclick="this.style.behavior='url(#default#homepage)';

this.setHomePage('http://www.apple-wallpaper.com');">

<img width=16 height=16 border=0 src="images/Logo.gif">

<u> 设为首页</u></a>




2.文字型:

<a οnclick="this.style.behavior='url(#default#homepage)';

this.setHomePage('http://www.apple-wallpaper.com');" href="#">设为首页</a>




3.按钮型:

<input TYPE="button" VALUE=" 设为首页 " οnclick="this.style.behavior='url(#default#homepage)';

this.setHomePage('http://www.apple-wallpaper.com');" href="#">




4.
离开时自动提示设为首页

<body οnunlοad="BASEBody.style.behavior='url(#default#homepage)';

if(!(BASEBody.isHomePage('http://www.apple-wallpaper.com')))BASEBody.setHomePage('http://www.apple-wallpaper.com/');">





5.
鼠标指向时提示设为首页

<A href="http://www.apple-wallpaper.com/" οnmοuseοver="this.style.behavior='url(#default#homepage)';

this.setHomePage('http://www.apple-wallpaper.com');" target="_blank">设为首页</A>


-------------------------------------------------------------------------------



加入收藏代码

1.

<a href="#" οnclick="javascript:window.external.AddFavorite('http://www.apple-wallpaper.com','苹果壁纸资源')" title="收藏本站到你的收藏夹"><font size="-1" color="#FFE09E">收藏本站</font></a>




2.

<a href="javascript:void(0);" onClick="window.external.AddFavorite(document.location.href,document.title)">加入收藏</a>




加入频道

<a href="typhoon.cdf")>加入频道</a>




邮件链接

<a href="mailto:xuan_web@hotmail.com">与我联系</a>

 

再将下面代码加入<body>内:  

οnlοad="myhomepage();"  

即:<body οnlοad="myhomepage();"> 


  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
HTML 页面中添加首页收藏代码可以让用户更方便地将你的网站添加到浏览器主页和收藏夹中。以下是一个示例代码: ```html <!DOCTYPE html> <html> <head> <title>My Website</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- 添加首页收藏代码 --> <link rel="icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"> <link rel="manifest" href="site.webmanifest"> <meta name="msapplication-TileColor" content="#da532c"> <meta name="theme-color" content="#ffffff"> <!-- end --> </head> <body> <!-- your website content here --> </body> </html> ``` 在这个示例中,我们添加了以下代码: ```html <link rel="icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"> <link rel="manifest" href="site.webmanifest"> <meta name="msapplication-TileColor" content="#da532c"> <meta name="theme-color" content="#ffffff"> ``` 这些代码会将网站图标添加到浏览器标签页和书签栏中,并且在将网站添加到主屏幕时也会显示。如果你想要自定义更多的内容,可以查看相关文档或者使用在线生成工具来生成相应的代码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值