html – Problems with placement of an element

Question:

I want to leave the date fixed in the right corner, considering the div is being created by a while and the date position doesn't depend on the length of the description.

<div style="background-color:grey;">
    <P>
        <a href=""><font size='5px'>Titulo</font></a><br>
        <p class="descricao_noticia"><font color='black' size='4px'>Descricao noticia</font></p>
        <font color='black' size='4px'>data</font>    
    </p>
</div>

Answer:

You have to place the display:inline-block and float on the right.

.descricao_noticia{
  width:80%;
  display:inline-block;
}

.data{
  text-align:right;
  display:inline-block;
  float:right;
}
<div style="background-color:grey;">
<P>
  
  <a href=""><font size='5px'>Titulo</font> </a>
  <br>
  <p class="descricao_noticia">
    <font color='black' size='4px'>Descricao noticia<br>Descrição Notícia<br>Descrição Notícia<br>Descrição Notícia</font>
  </p>   
  <p class="data"><font color='black' size='4px' id="data">data</font></p>
</P>
</div>
Scroll to Top
AllEscort