为了账号安全,请及时绑定邮箱和手机立即绑定

程序我写出来了,然而返回两个字和其它字不在一条线上,是不是只能用css调呢?

问题:程序我写出来了,然而返回两个字和其它字不在一条线上,是不是只能用css调呢?

正在回答

4 回答

<!DOCTYPE html>

<html>

 <head>

  <title>浏览器对象</title>  

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>   

 </head>

 <body>

  <!--先编写好网页布局-->

  <h1>操作成功</h1>

  <p><span id="sn"></span>秒后返回主页<a href="http://www.imooc.com/code/1633">返回</a></p>

 

  <script type="text/javascript">  

   //获取显示秒数的元素,通过定时器来更改秒数。

   var s=setInterval(secondsnum,1000);

   var sn=document.getElementById("sn")

   sn.innerHTML=5;

   function secondsnum(){

    if(sn.innerHTML==0){

    window.open("http://www.imooc.com/code/1633","_self");

    }else{

    sn.innerHTML--;

    }

   } 


   //通过window的location和history对象来控制网页的跳转。

   

 </script> 

</body>

</html>


0 回复 有任何疑惑可以回复我~
#1

慕妹7508549

window.open()那个地方可以改
2016-09-23 回复 有任何疑惑可以回复我~

恩,试试吧

0 回复 有任何疑惑可以回复我~

浏览器问题吧,我的好好的。

你可以用<p>标签将span和 a圈住,然后设置属性line-height和height 值相同就行,试试看。

0 回复 有任何疑惑可以回复我~

前面使用span标签,返回使用a标签,代码不要换行写

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

程序我写出来了,然而返回两个字和其它字不在一条线上,是不是只能用css调呢?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信