我是菜鸟,遇到问题,高手帮助!
[url=http://yuming.hangyexinwen.com/]http://yuming.hangyexinwen.com/[/url]如演示,我想在header加一个468*60广告,可是如论怎么改都错位,望解答!
[attach]5277[/attach]
[color=red]header.php 文件[/color]
<div id="header" class="clearfloat"><div id="header_l">
<div id="logo" class="fl"><a href="<?php echo get_option('home'); ?>/" title="<?php bloginfo('name'); ?>"><img src="<?php bloginfo('template_directory'); ?>/image/logo.png" alt="<?php bloginfo('name'); ?>" /></a></div>
<div id="siteinfo">
<div id="sitename" style="letter-spacing:5px"><h1><a href="<?php echo get_option('home'); ?>/" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1></div>
<div id="sitedesc" style="letter-spacing:1px"><?php bloginfo('description'); ?></div>
[color=magenta]<div class="ads ads468x60 fl"><?php include (TEMPLATEPATH . '/ads468x60.php'); ?></div>
[/color]</div></div><div id="header_r">
<a href="javascript:window.external.AddFavorite('<?php echo get_option('home'); ?>', '<?php bloginfo('name'); ?>')">收藏本站</a> |
<a href="#" >设为首页</a><br />
<!-- 此处请修改或删除 --><a href="#" target="_blank">邮件订阅</a> | <a href="<?php bloginfo('rss2_url'); ?>" target="_blank">Rss订阅</a>
</div></div>
[color=red]style.css 文件[/color]
/* Header */
#mininav{width:980px;height:24px;margin:0 auto;background:#f8f8f8;color:#888;border-bottom:1px solid #e6e6e6;line-height:24px}
#mininav a{color:#888;padding:0 2px;text-decoration:none}
#mininav a:hover,#header_r a:hover{color:#009900;text-decoration:underline}
#header{width:980px;height:80px;background:#FFF url(image/headerbg.jpg) no-repeat top right;margin:0 auto}
#header_l{width:800px;margin-top:15px;float:left}
#logo img{width:110px;height:52px;margin-left:12px}
#siteinfo{width:150px;height:52px;margin-left:122px}
#sitename{height:30px;line-height:30px;text-indent:15px;} #sitename a,#sitename a:hover{color:#2583AD;text-decoration:none}
#sitedesc{height:13px;line-height:13px;text-indent:18px;color:#2583AD;font-size:13px;padding-top:6px;font-family:"楷体_GB2312",Verdana,Arial;overflow:hidden;white-space:nowrap}
[color=magenta].ads{padding:0px;overflow:hidden}
.ads468x60{width:468px;height:60px}[/color]
#header_r{width:122px;margin-top:15px;float:right;line-height:25px;color:#888}
#header_r a{color:#009900;padding:0 2px;text-decoration:none}
紫色是我加的广告代码! 广告的div应该包含在 上你顶部的那个div中 你的好像两个是独立关系不是包涵关系的吧 谢谢啊,可是还是不懂!:( 大致可以这样
.ads{float:right;overflow:hidden;}
.ads468x60{width:468px;height:60px} 没有解决,只有等模板作者来解答了! 看了一下代码。。本来问题不大。。都是CSS的事
解决方法很多:
按造你的截图效果:siteinfo应该是没有的是吧
说一种吧。。
#siteinfo{display:none;}
.ads{padding:0px;overflow:hidden;float:left}
.ads468x60{width:468px;height:60px}
更改一下广告加在的位置
<div id="header" class="clearfloat"><div id="header_l">
<div id="logo" class="fl"><a href="<?php echo get_option('home'); ?>/" title="<?php bloginfo('name'); ?>"><img src="<?php bloginfo('template_directory'); ?>/image/logo.png" alt="<?php bloginfo('name'); ?>" /></a></div>
<div id="siteinfo">
<div id="sitename" style="letter-spacing:5px"><h1><a href="<?php echo get_option('home'); ?>/" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1></div>
<div id="sitedesc" style="letter-spacing:1px"><?php bloginfo('description'); ?></div>
</div><div class="ads ads468x60 fl"><?php include (TEMPLATEPATH . '/ads468x60.php'); ?></div></div><div id="header_r">
<a href="javascript:window.external.AddFavorite('<?php echo get_option('home'); ?>', '<?php bloginfo('name'); ?>')">收藏本站</a> |
<a href="#" >设为首页</a><br />
<!-- 此处请修改或删除 --><a href="#" target="_blank">邮件订阅</a> | <a href="<?php bloginfo('rss2_url'); ?>" target="_blank">Rss订阅</a>
</div></div>
我测试成功
页:
[1]