I need to line up 2 p with bootstrap

0

Good morning, I have the following code:

<div>
    <p class="mt-5 mb-3 text-black">¿No tienes cuenta?</p>
    <p class=""><a href="cuenta.html" target="_blank">Crear cuenta</a></p>
</div>

I need to align the two <p> horizontally. I appreciate the collaboration.

    
asked by Jaiver Lesmes 05.11.2018 в 04:55
source

3 answers

1

Friend there are several methods I will leave you 2 the first one is direct in the html

<div style="display:flex;"> 
    <p class="mt-5 mb-3 text-black">¿No tienes cuenta?</p> 
    <p class=""><a href="cuenta.html" target="_blank">Crear cuenta</a></p> 
</div> 

And the other is with the same div you assign a class and you add the CSS

.alinear{
    display:flex;
    }

And the html you add the class

<div style="display:flex;"> 
    <p class="mt-5 mb-3 text-black">¿No tienes cuenta?</p> 
    <p class=""><a href="cuenta.html" target="_blank">Crear cuenta</a></p> 
</div>

Both methods are thanks to the display flex property and you use the styles you want, such as padding or margin. I hope it serves you.

    
answered by 05.11.2018 / 06:14
source
0

Good to align objects you can use several methods such as:

  • Use the align attribute

    <!DOCTYPE>
    <html>
    <head>
    
    </head>
    <body>
          <p align="center"> hola</p>
    </body>
    </html>
    
  • Use the w3.css download the link file, put in the head link href="file location" and then put a class called w3-center

    <!DOCTYPE>
    <html>
    <head>
    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
    </head>
    <body>
          <p class="w3-center"> hola</p>
    </body>
    </html>
    
  • answered by 05.11.2018 в 16:55
    0

    Try this code:

    <div class="row">
       <div class="col-lg-2 col-lg-offset-1">
          <p class="mt-5 mb-3 text-black">¿No tienes cuenta?</p>
       </div>
       <div class="col-lg-2">
          <p class=""><a href="cuenta.html" target="_blank">Crear cuenta</a></p>
       </div>
    </div>
    
        
    answered by 07.11.2018 в 00:02