Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying labels in the same row

Tags:

html

css

I have this HTML code

<div style="display:inline" >
    <div>
        <label>NOM:</label>
    </div>
    <div>
        <label>Ben felten</label>
    </div>
</div>

I got this result:

im1

I need to change my code to get a result like this :

im2

I need the two labels displayed in the same line and each div (parent to each label) having a width of 50 percent of the page's width.

  1. How can i change my snipet to do that?

Thanks

like image 481
Lamloumi Afif Avatar asked Nov 25 '25 16:11

Lamloumi Afif


1 Answers

Try something like this:

  <div style="display:inline" >
        <div style="float: left; width: 50%;">
            <label>NOM:</label>
        </div>
        <div style="float: left; width: 50%;">
            <label>Ben felten</label>
        </div>
    </div>
like image 102
reaxis Avatar answered Nov 28 '25 15:11

reaxis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!