0

我对下面的代码有几个问题。

1) 我去 Twitter 网站获取嵌入“推文”按钮的代码,但有两个问题 - a) 按钮仅显示为链接,b) 我预先加载到推文框中的文本没有出现

2)我希望两个黄色按钮位于页面中央,彼此相邻。有人可以帮忙定位吗?

3)我可以去掉按钮内文本上的超链接吗?现在,该链接仅在您单击文本时才有效(如果您单击按钮上的任意位置,我希望它能够工作)。

非常感谢您的帮助。谢谢。

<!-- doc type declaration lets browser know which xhtml doc type declaration we are using -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
<title>SAMPLE TEXT</title>
</head>

<style type="text/css">


#wtf_title {font-family: "Garamond"; font-weight: bold; font-size: 200%; padding-top:50px}

#intro_text {font-family: "Helvetica", serif; color: black; padding-top:10px; 
font-style: italic;}

#reason {font-family: "Helvetica", serif; color: white; padding-top:50px; padding-bottom:50px;}

#credit 
{
    font-family: "helvetica"; 
    font-size: 20%; 
    color: black; 
    }

#button1 {padding-left:20px;}

button{
color:#08233e;
font:2.4em Futura, ‘Century Gothic’, AppleGothic, sans-serif;
font-size:70%;
padding:14px;
background:url(overlay.png) repeat-x center #ffcc00;background-color:rgba(255,204,0,1);
border:1px solid #ffcc00;
-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;
border-bottom:1px solid #9f9f9f;
-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.5);-webkit-box-shadow:inset 0 1px 0      rgba(255,255,255,0.5);box-shadow:inset 0 1px 0 rgba(255,255,255,0.5);
cursor:pointer;
}

button:hover{background-color:rgba(255,204,0,0.8);}

button:active{position:absolute;top:100px; left:50px}

</style>


<body>

<div id="wtf_title" >
<center>sample text<br/>
</div>

<hr noshade size=8 width="53%">

<div id="intro_text" >
<center>Sample text
</div>

<button>
<center><a href="" class="button1">sample text</a>
</button>

<button>
<a target="_blank" href="http://www.americanbar.org" class="button2">sample text</a>    
</button>

<div id="twitter-share-button"; style="position: absolute; top: 2px;" >
<a href="https://twitter.com/share" class="twitter-share-button" data- url="http://www.whatthefuckhaslebronjamesdone.com" data-text="Check this out:" data- count="none" data-hashtags="WTFLBJ">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s) [0];if(!d.getElementById(id)) {js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.in sertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>

<div id="fb_share"; style="position: absolute; top: 2px; left: 90px;" >
<a name="fb_share"></a> 
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" 
    type="text/javascript">
</script>
</div>


<div id="credit"; style="position: absolute; bottom: 5px; left: 32%;" >
This site was created by <a href="http://www.twitter.com/varunsshetty">Varun Shetty</a> and    <a href="http://www.twitter.com/bcfromblo">Bobby Corp</a>. Inspired by LBJ and <a href="http://www.whatthefuckhasobamadonesofar.com">WTF Obama</a>. Bobby loves Lebron; Varun loves the idea of Lebron.
</div>

</body>

</html>
4

1 回答 1

0

您的 HTML 在许多地方都无效,您确实需要在发布之前将您的 HTML 通过 WC3 验证器,这将为您节省大量时间和精力。

这是一个 jsfiddle 让你开始:http: //jsfiddle.net/RPc95/

为了使整个按钮可点击,您要么需要创建正确的提交/按钮元素,要么将 href 设置为看起来像按钮。

于 2012-06-12T14:37:55.080 回答