Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

HTML & CSS Text and image over a video background

effy

New Coder
Hello, I'm new to html and css and i'm learning through youtube tutorials.
I want to create a website but I'm stuck...
My first page contains 1 video that I use as a background and I want to put a text, a logo (img) and a menu over it, and then 3 images that appear when you scroll down.
When I dont put my three images, i have no problem to display my text and logo over my video-background but then, when I add them the text doesn't appear anymore and can't change the logo size...
I tried different tutorials to find a way to add my text over it but it still doesn't work, can someone help me ?

Here's a part of the HTML:
HTML:
  <div class="container">
            <div class="section">
                <div class="content">
                    <video src="video-introduction.mp4" muted loop autoplay></video>
                </div>
                <div class="overlay"></div>
                <div class="logo">
                    <img src="logo.PNG" alt="Logo">
                </div>
                <p>Web site title</p>
                <a href="#"> Nous contacter </a>
            </div>

            <div class="section">
                <div class="content">
                </div>
            </div>

and CSS:
Code:
.container
{
      position: relative;
      width: 100%;
      height: 100vh;
      overflow: auto;
}
.container .section
{
      position: relative;
      width: 100%;
      right: 0;
      min-height: 100vh;
      justify-content: space-between;
      align-items: center;
      text-align: center;
}
.container .section .content video
{
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    object-fit: cover;
    z-index: 1;
}
.container .section .content
{
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}
.logo img
{
    width: 10px;
    line-height: 5em;
    height: 39vh;
    justify-content: center;
    align-items: center;
    margin-top: 23vh;
}
.container .section .content p
{
    font-size: 1.3em;
    color: #fff;
    padding: 2px 30px;
    text-decoration: none;
    margin-top: 1vh;
}
.container .section:nth-child(2)
{
  background: url(macjauneentier.png);
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: 100% 50%;
}

Thank you (sorry I'm a beginner)
 

Latest posts

Buy us a coffee!

Buy me a coffee.
Back
Top Bottom