如何在我的网站上更改此天气预报窗口小部件的位置?

时间:2014-05-05 23:04:17

标签: javascript jquery html css

我去了这个地区的accuweather.com网站:

Accuweather

获得了正确的顶级小部件。 将代码复制到我的网站:

<a href="http://www.accuweather.com/en/il/hod-hasharon/212527/current-weather/212527" class="aw-widget-legal">
<!--
By accessing and/or using this code snippet, you agree to AccuWeather’s terms and conditions (in English) which can be found at http://www.accuweather.com/en/free-weather-widgets/terms and AccuWeather’s Privacy Statement (in English) which can be found at http://www.accuweather.com/en/privacy.
-->
</a><div id="awtd1399327708942" class="aw-widget-36hour"  data-locationkey="" data-unit="f" data-language="en-us" data-useip="true" data-uid="awtd1399327708942" data-editlocation="true"></div><script type="text/javascript" src="http://oap.accuweather.com/launch.js"></script>

但是它把小部件放在这个页面的中间位置,我希望它把它放在右侧,而不是在数字时钟下面的长黑色。

这就是我现在在网站上的样子:

My Test Site

修改

这就是我在主要包装中所做的:

<div id="main-wrap">
<div id="sidebar" style="float:right;">
    <a href="http://www.accuweather.com/en/il/hod-hasharon/212527/current-weather/212527" class="aw-widget-legal">
<!--
By accessing and/or using this code snippet, you agree to AccuWeather’s terms and conditions (in English) which can be found at http://www.accuweather.com/en/free-weather-widgets/terms and AccuWeather’s Privacy Statement (in English) which can be found at http://www.accuweather.com/en/privacy.
-->
</a><div id="awtd1399327708942" class="aw-widget-36hour"  data-locationkey="" data-unit="f" data-language="en-us" data-useip="true" data-uid="awtd1399327708942" data-editlocation="true"></div><script type="text/javascript" src="http://oap.accuweather.com/launch.js"></script>

是吗?我有tall-header.html short-header.html no-header.html和landing.html在其中一个将它添加到主包中它们都有div main-wrap。     

2 个答案:

答案 0 :(得分:2)

长黑色区域是您网页背景的一部分。

  1. <div id="main-wrap">中创建一个div,表示您想要窗口小部件的区域。 <div id="sidebar" style="float:right;"></div>会做。{/ p>

  2. 将窗口小部件代码复制到新div

答案 1 :(得分:0)

从accuweather获取新的更新代码。(你需要将它添加到你的style.css)你放在哪里取决于你(主菜单)。这将把它放在页面的右上角。我是把我的头发拉了一天试图让它工作。我知道这是一个两年前的线程,但我认为id回馈这个网站给我的所有帮助。

.aw-widget-current .aw-widget-current-inner { /*+placement: 865px -334px;*/ position: relative; left: 865px; top: -334px; }