Background color source code

Solved
Hello,
I'm looking for the source code to set a background color for text but not for the entire page, just at the top, as if I were creating a banner with the website title. I hope you understand what I mean.
Thank you in advance!

Configuration: Mac OS X / Safari 534.51.22

1 answer

  1. not quite

    try this
    <html>
    <head>
    <meta charset="utf-8">
    <title>Page</title>
    <style type="text/css">
    .banner
    {
    width:100%;
    height:160px;
    background-color:green;//or your favorite color
    }
    </style>
    </head>

    <body>
    <div class="banner">
    </div>
    </body>
    </html>
    1. Honestly, I couldn't have hoped for better. Thank you very much.
    2. You're welcome, but how did you manage to display [resolved] in this forum? I'm new to this forum.
    3. Just above the post title. And one last question... How do I put text in this colored area?
    4. So you need to ask this question under a different title so that others know it too, okay?
    5. and I thank you for your tip