Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 简单的HTML和CSS背景重复_Php_Html_Css - Fatal编程技术网

Php 简单的HTML和CSS背景重复

Php 简单的HTML和CSS背景重复,php,html,css,Php,Html,Css,我的网站是 如您所见,标题上的背景正在重复。我尝试添加背景重复:无重复添加到标题中的所有div,并且仍在重复。 这是我的header.php <?php /** * The Header for our theme. * * @package WordPress */ global $cubby_options; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.

我的网站是

如您所见,标题上的背景正在重复。我尝试添加
背景重复:无重复
添加到标题中的所有div,并且仍在重复。 这是我的header.php

<?php
/**
 * The Header for our theme.
 *
 * @package WordPress
 */
 global $cubby_options;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>
<?php wp_title('|', true, 'right'); ?>
</title>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<center>
<div class="header">
  <div class="top">
    <div class="container">
      <div class="contact left">
        <?php  echo cubby_options_array('top_contact_info') ; ?>
      </div>
      <div class="follow right"> <?php echo cubby_get_social_network(array("skype","facebook",'twitter','google_plus','youtube',"linkedin",'pinterest','rss'));?> </div>
    </div>
  </div>
  <div class="top2">
    <div class="container">

      <div class="logo left"><a href="<?php echo esc_url(home_url('/')); ?>">
        <?php if ( cubby_options_array('logo')!="") { ?>
        <img src="<?php echo cubby_options_array('logo'); ?>" alt="<?php bloginfo('name'); ?>" />
        <?php }else{ ?>
        <span class="site-name">
        <?php bloginfo('name'); ?>
        </span>
        <?php }?>
        </a><span class="tagline"><?php echo  get_bloginfo( 'description' );?></span></div>
    </div>
    </div>
    <div class="menu_bottom">
    <?php do_action('wp_menubar','Home'); ?>
    </div>
  </div>
</div>
</center>
<!--header-->
对不起,我对html和css不熟悉。我还想知道,为什么在样式表中它将类声明为具有颜色作为背景,但在页面上它显示了图像?
感谢所有回复:)

请检查您的代码。因为你有:

    .header .top2 {
url("http://www.nickliddell.com/pieres/wp-content/uploads/2014/05/cropped-header1.png") repeat scroll 0 0 rgba(0, 0, 0, 0)
}
上面写着重复。将其更改为:

.header .top2 {
    background-image: url("http://www.nickliddell.com/pieres/wp-content/uploads/2014/05/cropped-header1.png");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

另外,如果你是新来的。如果你喜欢我输入的内容,你就会更容易看到错误;)

你能减少代码的数量,这样它仍然可以显示你的问题,但更容易让我们阅读吗?如果这是你的代码中的一个片段,你应该检查一下。因为我想不是所有的事情都像你想的那样。你有
min高度:60px;左边距:自动;右边距:自动;背景重复:无重复没有任何链接到它的元素。另外,使用
margin:0 auto-这与
左边距:自动相同;右边距:自动你在哪里看到“.header.top2”?它在你的一个.php文件中。它不在任何css文件中。所以我猜,在index.php或(single.php(?)的
中。
.header .top2 {
    background-image: url("http://www.nickliddell.com/pieres/wp-content/uploads/2014/05/cropped-header1.png");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}