این کد index.php
<!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 profile="http://gmpg.org/xfn/11">
<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo
('charset'); ?>" />
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats
please -->
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>"
/>
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_get_archives('type=monthly&format=link'); ?>
<?php //comments_popup_script(); // off by default ?>
<?php wp_head(); ?>
</head>
<body>
<div align="center">
<div id="wrapper">
<?php get_header(); ?>
</div>
</div>
</body>
</html>
این کد style.css
body, h1, h2, h3, h4, h5, h6, blockquote, p, form{
margin: 0;
padding: 0;
}
Body {
margin: 2px 0px 2px 0px;
font-family: tahoma;
font-size: 10px;
color: black;
background: url('images/bg.gif');
SCROLLBAR-FACE-COLOR: #FFFFFF;
SCROLLBAR-HIGHLIGHT-COLOR: #000000;
SCROLLBAR-SHADOW-COLOR: #FFFFFF;
SCROLLBAR-3DLIGHT-COLOR: #C0C0C0;
SCROLLBAR-ARROW-COLOR: #000000;
SCROLLBAR-TRACK-COLOR: #FFFFFF;
SCROLLBAR-DARKSHADOW-COLOR: #FFFFFF;
direction: rtl;
}
img {
border: none;
}
a, a:visited {
color: black;
text-decoration: none;
font-weight: bold;
width: 100%;
}
a:active {
color: red;
text-decoration: none;
font-weight: bold;
width: 100%;
}
a:hover {
color: red;
text-decoration: none;
font-weight: bold;
width: 100%;
}
#wrapper {
width: 960px;
}
.header {
margin: 0px;
padding: 0px;
background: white url('images/header.jpg');
width: 960px;
height: 100px;
font-family: tahoma, times new roman;
text-align: right;
border-top: solid 1px #C0C0C0;
border-right: solid 1px #C0C0C0;
border-left: solid 1px #C0C0C0;
}
اینم کد header.php
<div class="header">
<a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>"> <?php bloginfo('name'); ?> </a>
<br />
<?php bloginfo('description'); ?>
</div>
البته اینو بگم اگه کد header.php رو به index.php انتقال کنیم چنین فاصله ای ایجاد نمیشه.
علاوه بر این اگه sidebar.php و footer.php را همینطور کنم خود به خود ازbody-margin-top می گیره یعنی فاصله از بالا.
پیوست:
http://s1.picofile.com/file/6459611666/header.jpg