Problem with Background Html / Css

8

I created a id in css with a background. When I put div in html the background becomes beauty, but when I put a <form> , the part it occupies becomes white.

Note:whenIputboldtextinit,too.

HowcanIresolvethis?

Here's an example in JSFiddle and my code looks like this:

CSS

#backgroundSlider{
   width: 100%;
   background: #000;
   height: 300px;
}

HTML

<!DOCTYPE html>
<meta charset="UTF-8">
<html>
    <head><title>Página de Contato</title>
        <link rel="stylesheet" href="styles.css">
    </head>
<body>
<div id="site">
    <div id="barramenu">menu menu menu menu</div>
    <div id="backgroundSlider">
    slider
        <form>
            Nome: <input type="text" name="nome"/><br>
            Email: <input type="email" name="email"/><br>
            Mensagem: <input type="text" name="menssagem"/><br>
            <input class="button" type="submit" value="Enviar"/>
        </form>
    </div>
    <div id="backgroundInfo">
    Background info
    </div>
    <div id="rodape">rodape</div>

</div>
</body>
</html>
    
asked by anonymous 19.03.2014 / 13:20

1 answer

11

Seeing your fiddle , the problem is in the same CSS. You have a rule

*{
    background-color:   #FFF;
    margin: 0px;
    padding: 0px;
}

So that's the problem, because you're setting all the elements (operator *) a white background color, which is why when you add the form the background becomes white.

    
19.03.2014 / 14:00