Working with Labels in CSS

0

When we use attributes like Label the text is written from left to right. Can we change that? Make the text start for example from the middle to the sides or from the right to the left?

Example:

----> Left to right

| MY TEXT ---- |

How accurate (+ is the center)

< ---- ---- >

| Ipan + ema |

or

Right to Left

| ---- MY TEXT |

Is this possible? Thanks!

    
asked by anonymous 15.07.2016 / 15:04

2 answers

1

I do not understand if your question is about alignment or orientation in writing. I'll answer both then.

ALIGNMENT

Align a <label> on the left:

<div style="width:100%;text-align:left">
    <label>MEU TEXTO</label>
</div>

Align a% centralized%:

<div style="width:100%;text-align:center">
    <label>MEU TEXTO</label>
</div>

Align a <label> to the right:

<div style="width:100%;text-align:right">
    <label>MEU TEXTO</label>
</div>

View demo here .

ORIENTATION

Right to left:

<div style="direction:ltr;">
    <label>MEU TEXTO</label>
</div>

From left to right:

<div style="direction:rtl;">
    <label>MEU TEXTO</label>
</div>

View demo here .

    
15.07.2016 / 15:51
0

I do not understand very well but from what I understand you want this:

            label{display:block;}
            form{width: 200px;border: 3px solid #4e4e4e;padding: 15px 15px;border-radius: 3px;}
            label#label-01{text-align: left;}
            label#label-02{text-align: right;}
            label#label-03{text-align: center;}
            input{width: 100%;}
        <form action="">
            <label for="" id="label-01">Label 01</label>
            <input type="text">
            <br><br>
            <label for="" id="label-02">Label 02</label>
            <input type="text">
            <br><br>
            <label for="" id="label-03">Label 03</label>
            <input type="text">
            <br><br>
            <button>Enviar</button>
        </form>
    
15.07.2016 / 15:52