How do I place an image that will scroll over the background and under the texo?

Asked

Viewed 1,587 times

0

I’m learning HTML alone (doing research and free courses on the internet), I came across the following problem:

I have a background image that was correctly applied, but I am not able to add another image correctly, it is cropped (I put a picture of how it looked), which will be below the text and will scroll along with the Scroll page, and stay on top of the background.

Foto mostrando como ficou visualmente.

Obs.: My style is being edited into another file called estilo.css, and not directly on HTML.

Obs.: I’m quite a beginner in html and css.

Just follow my code CSS:

@charset "utf-8";

body {
    background-image: url("../_imagens/fundo1.jpg");
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    color: rgba(250, 250, 250, 0.8);
}

h1 {
    text-align: center;
}

div.logo {
    background-image: url("../_imagens/logoktg.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: scroll;
}

Follow the html code:

<!DOCTYPE html>
<html lang="pt-br">

<head>
    <meta charset="UTF-8">
    <title>Ka-Tet Gaming</title>
    <link rel="stylesheet" href="_css/estilo.css"/>
</head>
<body>
    <div id="header">
        <div class="logo" id="logo">
        <header id="cabecalho">
            <hgroup id="titulo">
                <h1>Seja Bem Vindo ao Site da KTG!</h1>
                <h2>Time Range 1 da PlayerLink.</h2>
            </hgroup>
        </header>
        </div>
    </div>
</body>
</html>
  • The image you want to put is that of the logo ?

  • Yes, it is. I updated the post and the codes, because I could put the image, but I could not adjust it.

1 answer

0


I guess what you’re missing is knowing which property you should use.

For this I strongly recommend the following study script:

  1. Understand the property display of css

    Ex: What difference between inline and block ?

  2. Understand the property float of css

    With the knowledge of display + float you will already be able to build a layout complete to one page.

  3. Understand the property position of css

    With the knowledge of display + float+ position you will already be able to build a layout full idenpendente if it is for web, mobile phone, tv...


I’ll try to make an analogy to try to help:

A website is like a house.

HTML is equal to a plastered wall

CSS is equal to plaster+decoration

Javascipt is equal to rightec

HTML + CSS + Javascrip complement

  • But wouldn’t studying CSS get in the way of my knowledge of HTML? I ask this because most of the people who are programmers say that if I want to study programming, I should start with HTML, as I said, I’m very beginner in programming, so I’m making a lot of mistakes kkk But thank you for telling me already that if I learn what you’ve been through, I’ll be able to fix this mistake I’m having. I really appreciate !!

  • I did an update on the reply

  • Got it, thanks a lot for your help!!

Browser other questions tagged

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