Div Relative Inside tag Center Inside Div Fixed

Asked

Viewed 17 times

-1

I want to leave paginations in the center of the div and grow centrally, but this div has to be fixed so I thought to leave inside another div

relative inside other relative does not fit with the content size, when placing "max-width:100%, width:auto" even if there is little content it will show the value of max-width.

placing relative inside a Fixed does not center already lost a lot of time in it and I’m with a horrible system without hard drive

<?php 
 function paginacoes() {
 echo "<center>";
    echo "<div style='background:black; 
          color: white;
          width:auto;
          height: 18px;
          border: 3px solid blak;
          position: relatived; or fixed;
          top: 100px;
          max-width:90%;
         '>";
    $i=1;
    while($i !=26) {
        echo "<div style='background:black; 
              color: white;
              padding-left: 10px;
              padding-right: 10px;
              height: 18px;
              float: left;
              border: 3px solid blak;
              position: relative;
             '>$i</div>";
 $i++;
    }
    echo "</div>";
    echo "</center>";
}
paginacoes();
?>

Happy New Year!

1 answer

0

I did it! I share ;)

<style>
*{margin:0;padding:0;}

body{height:120%}

#externa {
align-items: center;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
}
#interna {
top:0px;
position:fixed;
max-width: 200px; /* Valor da Largura do elemento */
background:red;
}
</style>

<div id="externa">
<div id="interna">
asddddddddcc
</div>
</div>

Browser other questions tagged

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