Problem with a class in css and html

Asked

Viewed 1,103 times

0

Well I’m in trouble when I call the background in body{} it appears as it is in img: inserir a descrição da imagem aqui

but when I use the same css code for a div or a Section it appears nothing .

as in this image : inserir a descrição da imagem aqui

Well the css code in question is this;

.slidee
{
    margin: 0px;
    overflow: hidden;
    background-image: url(../../image/BannerWithText.png);
    background-position: top center;
    background-repeat: no-repeat;   
    background-attachment: fixed;
    background-size:100% auto;
}

when I switch from . slide to body{} appears normal, but the call from Section class="slide" appears nothing ..

html code:

<!DOCTYPE html>
<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>Secure Elo Bosting</title>
    <link rel="stylesheet" href="css/estilos.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/font-awesome.css">

    <script src="js/jquery-3.2.1.js"></script>
    <script src="js/main.js"></script>
</head>
<body>
        <header>
        <span id="button-menu" class="fa fa-bars"></span>

        <nav class="navegacion">
            <ul class="menu">
                <!-- TITULAR -->

                <!-- TITULAR -->

                <li><a href="#"><span class="fa fa-home icon-menu"></span>Inicio</a></li>

                <li class="item-submenu" menu="1">
                    <a href="#"><span class="fa fa-suitcase icon-menu"></span>Serviços</a>
                    <ul class="submenu">

                        <li class="go-back">Voltar</li>
                        <li><a href="#">MD10</a></li>
                        <li><a href="#">Elo Boosting</a></li>
                        <li><a href="#">Duo Boosting</a></li>
                        <li><a href="#">Vitorias</a></li>
                    </ul>
                </li>


                <li><a href="#"><span class="fa fa-envelope icon-menu"></span>Duvidas Frequentes</a></li>
                <li><a href="#"><span class="fa fa-tag icon-menu"></span>Contato</a></li>
            </ul>
        </nav>
    </header>
    <section id="slide">
<div class="slidee">
    </div>
    </section>
</body>
</html>

2 answers

0

There are two possible errors, "possible because it depends on your intention. 1. If in CSS you are wanting to reference the ID you are in, you should reference it using "#". 2. If you want to reference the "slidee" class, note that in HTML there are two "ee" (slidee), then in css it should be the same.

.slidee
{
    margin: 0px;
    overflow: hidden;
    background-image: url(../../image/BannerWithText.png);
    background-position: top center;
    background-repeat: no-repeat;   
    background-attachment: fixed;
    background-size:100% auto;
}

  • The first part I did not understand mt well, the second part I understood and tidied up, but continued the same way. The only way q appears the background or any other img is by using the so-called body{} if it is not with the body does not appear and I wanted to do a slide down the menus .

0


Good afternoon Felipe, this happens because the body has a height of the entire body of the page, so you can see the image. Already in class . slidee it doesn’t have a size, so it doesn’t seem to work, try to set a min-height in . slidee, something like that:

.slidee{ min-height: 300px; }

I believe that’s it, try it there!

  • You’re the dude bro, vlw !!.

  • only a brother doubt you have knowledge in php mysql and jscript?

  • Oops, I’m glad it worked out!

  • I have a basic knowledge of the languages cited Felipe, among them I believe that Mysql to handle SQL is my strong

  • Ahh pq I’m willing to pay someone to pdoer make a system for me have no idea which language can be used, but if you are interested leave me a contact your .

  • We can talk about it man, I’ll give you my contacts: e-mail: [email protected] cellular: (14) 99720-8435

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.