HTML text alignment

attached image.

p89CO.jpg

I am trying to get a text format as shown at the very right end. that is, within the height of the sketch name (36px), time, date should be displayed vertically. I have a problem displaying text vertically. Here is my code -

<div id="sresults" style="position:absolute;top:120px; left:36%;">
    <div id="0" style="width:500px;padding:5px;cursor:pointer;clear:both;">
        <div id="content0" style="float:left; font-size:13px;">"Hey dude how are you doing?"</div>
        <div id="meta0" style="float:right;">
           <img src="http://www.mnducksvolunteer.org/_/rsrc/1262377955090/services/Google-Contacts-32.png" width="36px" title='Google Contacts'></img>
           <img src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs455.snc4/49881_1146922913_477096_q.jpg" width="36" title="peter"></img>
           <div id='name' style="float:right; font-size:11px">Peter</div>
           <div id='time' style="float:right;font-size:11px;">19:23</div>
           <div id='date' style="float:right;font-size:11px;">23 Dec'10</div>
        </div>
    </div>

To be precise, I want the name div id, 'time', 'date' to be aligned as in the image. as?

Also note that a div with id = "0" is one of the results, there will be 10 such objects on the page under <div id="sresults">

+3
source share
2 answers

Here you want: http://www.bravegnuworld.com/rjune/test.html

.. div, ? div ( , ). div, - . "float: right" "display: inline-block", div . .

<div id="sresults" style="position:absolute;top:120px; left:36%; background:yellow">
  <div id="0" style="width:500px;padding:5px;cursor:pointer;clear:both; background:red">
    <div id="content0" style="float:left; font-size:13px; background:blue">"Hey dude how are you doing?"</div>
    <div id="meta0" style="float:right; background:green">
     <img src="http://www.mnducksvolunteer.org/_/rsrc/1262377955090/services/Google-Contacts-32.png" width="36px" title='Google Contacts'></img>
     <img src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs455.snc4/49881_1146922913_477096_q.jpg" width="36" title="peter"></img>
      <div style="float:right">
        <div id='name' style="font-size:11px">Peter</div>
        <div id='time' style="font-size:11px;">19:23</div>
        <div id='date' style="font-size:11px;">23 Dec'10</div>
      </div>
    </div>
</div>
+4

table div, :

<div id="sresults" style="position:absolute;top:120px; left:36%;">
    <div id="0" style="width:500px;padding:5px;cursor:pointer;clear:both;">
        <div id="content0" style="float:left; font-size:13px;">"Hey dude how are you doing?"</div>
        <table id="meta0" style="float:right;">
            <tr>
                <td>
                    <img src="http://www.mnducksvolunteer.org/_/rsrc/1262377955090/services/Google-Contacts-32.png" width="36px" title='Google Contacts'/>
                    <img src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs455.snc4/49881_1146922913_477096_q.jpg" width="36" title="peter"/>
                </td>
                <td style="text-align:right;">
                   <div id='name' style="font-size:11px">Peter</div>
                   <div id='time' style="font-size:11px;">19:23</div>
                   <div id='date' style="font-size:11px;">23 Dec'10</div>
                </td>
            </tr>
        </table>
    </div>
</div>

UPD

divs:

<div id="sresults" style="position:absolute;top:120px; left:36%;">
    <div id="id0" style="width:500px;padding:5px;cursor:pointer;clear:both;">
        <div id="content0" style="float:left; font-size:13px;">"Hey dude how are you doing?"</div>
        <div id="meta0" style="float:right;">
            <img src="http://www.mnducksvolunteer.org/_/rsrc/1262377955090/services/Google-Contacts-32.png" width="36px" title='Google Contacts' style="float: left;"/>
            <img src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs455.snc4/49881_1146922913_477096_q.jpg" width="36" title="peter" style="float: left;"/>
            <div style="text-align:right; float:right">
                   <div id='name' style="font-size:11px">Peter</div>
                   <div id='time' style="font-size:11px;">19:23</div>
                   <div id='date' style="font-size:11px;">23 Dec'10</div>
            </div>
        </div>
    </div>
</div>
+1

Source: https://habr.com/ru/post/1783398/


All Articles