right div align

Asked

Viewed 161 times

2

I’m trying to align this div on how much right of the screen and it’s just left

    <div class="tres">
<iframe data-aa='861335' src='#' scrolling='no' style='width:120px; height:60px; border:0px; padding:0;overflow:hidden' allowtransparency='true'></iframe>
</div>

css used

div.tres {
 position: absolute;
 justify-content: center;
 align-items: center;
 background-color:  gray;
 border: 2px solid; /* As 4 bordas sólidas com 25px de espessura */
 border-color: gray  gray gray  gray; /* cores: topo, direita, inferior, esquerda */
 }

div.tres {
 position: absolute;
 justify-content: center;
 align-items: center;
 background-color:  gray;
 border: 2px solid; /* As 4 bordas sólidas com 25px de espessura */
 border-color: gray  gray gray  gray; /* cores: topo, direita, inferior, esquerda */
 }
<div class="tres">
<iframe data-aa='861335' src='#' scrolling='no' style='width:120px; height:60px; border:0px; padding:0;overflow:hidden' allowtransparency='true'></iframe>
</div>

2 answers

3


div.tres {
 float: right;
 justify-content: center;
 align-items: center;
 background-color:  gray;
 border: 2px solid;
 border-color: gray  gray gray  gray; 
 }

1

Just add a right : 0, if you want to remain absolute...

div.tres {
 position: absolute;
 right: 0;
 justify-content: center;
 align-items: center;
 background-color:  gray;
 border: 2px solid; /* As 4 bordas sólidas com 25px de espessura */
 border-color: gray  gray gray  gray; /* cores: topo, direita, inferior, esquerda */
 }
<div class="tres">
<iframe data-aa='861335' src='#' scrolling='no' style='width:120px; height:60px; border:0px; padding:0;overflow:hidden' allowtransparency='true'></iframe>
</div>

Browser other questions tagged

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