Home > database >  HTML - Move text by window size
HTML - Move text by window size

Time:06-30

Hey I want to move a text when I resize the window but it goes behind the window.... Does anyone know how to fix something like this?

.DISCORD {
    position: absolute;
    color: white;
    font-family: 'Poppins-Light';
    text-decoration: none;
    top: 3vh;
    left: 208vh;
    font-size: 3vh;
}
    <!--DISCORD LINK-->
    <a  target="_blank" href="https://discord.domain.com/">DISCORD</a>

first picture

other picture

CodePudding user response:

Both of your pictures look exactly the same, and your code snippet is emtpy.

Did you give position: relative; to the parent element?

The reason why your text moves out of the screen is probably because your left: 208vh; is to much, try to adjust that property within the devtools of your browser. Try it maybe with pixel.

It could help if you could post your code into the snippet.

CodePudding user response:

First of all, both images are same. So not clear about the issue. As I understood, you want to see the button all the time at top-left of the page. What you can do is: add left, and top positions with px, rem, etc and make sure that any of its parent elements don't contain position relative.

  • Related