我是wordpress的新手,这是我转换的第一个html网站。在我将页面转换为wordpress主题后,我注意到页面的所有侧面都有一个空白。这只发生在转换之后,因为我的原始html页面没有空格。我有*{填充:0;边距:0;}在我的css上,但在wordpress上似乎不起作用。
标题。php
<?php
/**
* The template for displaying the header
*
*
* @package WordPress
* @subpackage Twenty_Fifteen
* @since Twenty Fifteen 1.0
*/
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My Theme</title>
<meta charset="<?php bloginfo( \'charset\' ); ?>">
<meta name="viewport" content="width=device-width">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( \'pingback_url\' ); ?>">
<link rel="stylesheet" href="<?php bloginfo(\'stylesheet_url\'); ?>" type="text/css"
media="screen" />
<?php wp_head(); ?>
</head>
<?php
if(is_home()):
$awesome_classes = array(\'awesome-class\', \'my-class\');
else:
$awesome_classes = array(\'no-awesome-class\');
endif;
?>
<body <?php body_class($awesome_classes); ?>>
<div class="container">
<h2 class="logo">MY WEBSITE</h2>
<?php wp_nav_menu(array(\'theme_location\'=>\'primary\')); ?>
页脚。php
</div>
<footer class="thefooter">
<p>Copyright 2015 My Website - All Rights Reserved</p>
<?php //wp_nav_menu(array(\'theme_location\'=>\'secondary\')); ?>
</footer>
<?php wp_footer(); ?>
</body>
</html>
样式。css
/*
Theme Name: My Theme
Theme URL: wordpress.com/index.php
Author: Rendell Lasola
Description: This is an awesome theme
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: black, white, responsive, one-column, two-columns, featured-images,
custom-menu, custom-header, post-formats
*/
*{
padding: 0;
margin: 0;
font-family: Arial;
list-style-type: none;
}
.container{
width: 100%;
max-width: 1020px;
margin: auto;
}
h1,.widget-title{
display: none;
}
h2.logo{
float: left;
font-family: Azedo;
font-size: 2em;
padding: 10px;
}
#menu-navigation{
float: right;
padding: 10px;
}
#menu-navigation li{
display: inline-block;
font-weight: bold;
padding: 15px;
}
#menu-navigation li a{
text-decoration: none;
font-family: Arial;
font-weight: bold;
color: #2C3E50;
-webkit-transition: 0.4s all;
-moz-transition: 0.4s all;
-ms-transition: 0.4s all;
-o-transition: 0.4s all;
transition: 0.3s all;
}
#menu-navigation li a:hover{
color: #1E8BC3;
}
.container .jumbotron{
background: url(\'images/Jumbotron-wallpaper.png\');
width: 1020px;
max-width: 100%;
height: 431px;
clear: both;
}
.container .content{
text-align: center;
font-family: Arial;
color: #22313f;
}
.container .content h2{
padding: 20px;
}
.container .content article{
width: 284px;
margin: 0 auto;
display: inline-block;
vertical-align: top;
padding: 10px
}
.container .content article aside h4{
padding: 10px;
font-size: 1.5em;
}
.container .content article aside p{
width: 100%;
text-align: justify;
padding-top: 10px;
font-weight: bold;
}
.thefooter{
background: #22313f;
min-height: 75px;
margin-top: 75px;
text-align: center;
}
.thefooter p{
padding: 28px;
font-family: Arial;
font-weight: bold;
color: #FFF;
}
@media(min-width: 240px) and (max-width: 768px){
h2.logo{
float: none;
text-align: center;
}
#menu-navigation{
float: none;
text-align: center;
}
#menu-navigation li{
display: block;
}
.container .jumbotron{
background-position: 50%;
}
}