如何将网站弹出窗口的 html 转换为移动兼容网站


How do I convert the html of a website popup into a mobile compatible site?

我有一个弹出窗口,显示我的网站上有以下代码,它使用 async-Twitter 库与 Twitter 连接/授权。

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

1)在iOS(苹果设备)上与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 中以百分比编码

这里有一个教程:css 中的百分比

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

移动设备编码

3 - 对于不同的模式,除了全局样式外,保持两个样式

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

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