javascript - 如何将弹出网站的 html 转换为移动兼容网站?

标签 javascript php html ios css

我的网站上出现了一个弹出窗口,其中包含以下代码,它使用 async-twitter 库与 twitter 连接/授权。

如何将以下代码转换为移动兼容网站,以便它执行以下操作:

1) 适用于 iOS(Apple 设备)上的 Safari

2)以移动设备为中心,而不是偏离中心......

<!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>
<script src="http://platform.twitter.com/anywhere.js?id=[twitter-apikey]&v=1" type="text/javascript"></script>
<!--STYLE-->
<style type="text/css">
body {background-color: #10661A; font-family:Arial, Helvetica, sans-serif;}
#logo {background-image:url(\'img/logo.png\'); width: 770px; height: 104px;  }
#content { background-color:#FFF; width: 770px; hddeight: 334px; }
.connect { width: 249px; height:49px; display:block; background:transparent url(\'img/button.png\') center top no-repeat; }
.connect:hover { background-image: url(\'img/buttonhover.png\'); }
.title { color: #1c1c1c; padding-top: 20px; padding-left: 20px; margin-bottom: 20px; font-weight: bold; margin-top: 0px; }
.tweet { padding: 7px 100px; font-size:13px; line-height:19px; margin-left: 20px; margin-right: 20px; text-align:left; color: #343434; background-color: #eeeeee; border: 1px solid #e0e0e0; }
.link { font-style:italic; font-size:13px; line-height:19px; color: #197da4; }
.link2 { font-size:11px; text-decoration:underline; line-height:19px; color: #c2eeff; }
.account { font-weight: bold; font-size:14px; line-height:19px;  margin: 0 20px 10px 20px; padding-top: 7px; padding-bottom: 7px; text-align:center; color: #3e3e3e; background-color: #eeeeee; border: 1px solid #e0e0e0; }
.button { background-image:url(\'img/button.png\'); background-repeat:no-repeat;  color:#FFF; font-size:16px; text-decoration:none;  padding: 5px 33px 5px 33px; font-weight: bold; width: 284px; }
.ads { font-size:11px; text-align:center; color:#FFF; margin-top: 25px; }
.p1 { font-size: 13px; color: #7f7f7f; text-align:center; margin: 0px; padding-top: 10px; line-height: 18px; }
.line-separator{height:1px; border-bottom:1px solid #c8dbe3; width: 730px; margin-left: 20px; margin-top: 10px; }
</style>
<!--END STYLE-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[title]</title>
</head>

<body>
<script type="text/javascript">
    twttr.anywhere(function (T) {
        T("#tweet").linkifyUsers();
        T("#account").linkifyUsers();
        T.hovercards();
    });
</script>

<div id="logo"></div>
<div id="content">
        <p class="p1">Stuff here... Stuff here... Stuff here... Stuff here... </p>
        <p class="p1">Stuff here... Stuff here... Stuff here... Stuff here...</p>
        <div class="line-separator"></div>
        <p class="title">Stuff here... Stuff here... Stuff here... Stuff here... </p>
        <center><a href="[twitter-authorization-url]" class="connect" title="Click to authorize with twitter"></a></a></center>
</div>
<p class="ads">Copyright &copy; 2013 <a href="http://website.com/" class="link2">website</a>. All Rights Reserved.</<p> 
</body>
</html>

我将非常感谢任何可能的帮助。

提前致谢 - 海福莱克斯

最佳答案

1 - 尝试在 CSS 中以百分比进行编码

这里有一个教程:percentage in css

2 - 对于移动设备添加 css - 浏览我在那里的答案。

coding for mobile devices

3 - 对于不同的模式,除了全局样式之外,还保留两种样式

/* landscape */ @media screen and (orientation:landscape) 
@media screen and (orientation:portrait)

尝试一下你会得到一个非常响应式的设计:)

关于javascript - 如何将弹出网站的 html 转换为移动兼容网站?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18807402/

相关文章:

javascript - Angular : Sort by list of properties with mixed ASC and DESC

javascript - 将数据表中的默认 Spring-Boot DateTime 转换为人类可读的日期时间

javascript - jquery函数作用域

javascript - 如何将空数组添加到对象数组?

php - 如果数据是唯一的,则将数据添加到数据库

php - laravel eloquent 中深度嵌套关系中的 withSum

php - 为什么我收到此错误,一切看起来都正确 : "Undefined index"?

javascript - 响应式导航栏 - 调整大小时元素不会消失

html - 使用 CSS 格式化 HTML 段落

html - css3 firefox 无法让多个动画工作