Css背景图像无法解决

时间:2017-11-12 14:16:59

标签: html css twitter-bootstrap

我正在尝试选择header-logo我尝试了css选择器

建议的以下选择器
testCharacter = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, 3, 5);

int* w;
int* h;
Uint32* format;
int* access;

if (SDL_QueryTexture(testCharacter, format, access, w, h) != 0) {
    cout << "ERROR : " << SDL_GetError() << endl;
} else {
    cout << "no error" << endl;
}

cout << "width is : " << *w << " height is : " << *h << endl;

对于下面的html

body > div > div.header-logo
{
    background-image: url("logo.png");


}

但是当我在Chrome中查看时,它显示未解决的

enter image description here

2 个答案:

答案 0 :(得分:0)

您不需要>符号来跟踪您在元素时使用空格的元素,如果其子元素使用.

example : body div.header-logo

你可以找到有用的css here

教程

答案 1 :(得分:0)

div>div.header-logo
{
    background-image: url("https://tproger.ru/wp-content/uploads/2015/03/stack-overflow-logo-2.png");
    width: 720px;
    height: 270px;
}
<!DOCTYPE html>
<html>
<head>

   <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <link rel="stylesheet" href="style.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>

    <body>
    <div class="header">
        <div class="header-text">100+ Years Of Combiend Industry Expierence</div>

<div class="header-logo"></div>                   

        </div>

    </body>
</html>

但是,如果您不添加徽标,请执行以下操作:

<div class="header-logo">
  <img src="logo.png" alt="It's a logo">
</div>