Results 1 to 8 of 8

Thread: [RESOLVED] Problem with css - can't align the text

Threaded View

  1. #1

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Resolved [RESOLVED] Problem with css - can't align the text

    Hi

    I'm kind of making my own chat. And it's so far tested and working.
    So, I tried to give a pleasing look by adding some CSS. I have made a photoshop design and I'm implementing it as CSS and HTML.

    The problem is, when a chat message is displayed, I want to display the avatar, followed by the date and time and username + msg.
    But I'm having trouble with the username+msg part, which should in a line below the date and time. I have attached a image. The first msg row is what my current css renders. And what I want to achieve is shown in the second row(the red text)

    I hope I didn't confused you.

    HTML:
    html Code:
    1. <div id="chatwrapper">
    2.                     <div class="chatbox">
    3.                         <div class="avatar">
    4.                             <img src="akhileshbc.png">
    5.                         </div>
    6.                         <span class="chat_date">
    7.                             Oct 22, 2011 9:50 AM
    8.                         </span>
    9.                        
    10.                         <span class="chat_msg">
    11.                             Hi, how are you guys....hhsadalkjdlasdjlkasd
    12.                             asdkalskdjaljdlasd
    13.                             asdlasdklasldkjaskdjlkasd
    14.                             asdasioduouasdasudoiusaoduoasudusaodsauoduasodusaod
    15.                             saldjksadjlsadlskaldhhsadlsa
    16.                         </span>
    17.                     </div>
    18.                                         <!-- end of first chat row -->
    19.  
    20.                     <div class="chatbox">
    21.                         <div class="avatar">
    22.                             <img src="akhileshbc.png">
    23.                         </div>
    24.                         <span class="chat_date">
    25.                             Oct 22, 2011 9:50 AM
    26.                         </span>
    27.                        
    28.                         <span class="chat_msg">
    29.                             Hi, how are you guys....hhsadalkjdlasdjlkasd
    30.                             asdkalskdjaljdlasd
    31.                             asdlasdklasldkjaskdjlkasd
    32.                             asdasioduouasdasudoiusaoduoasudusaodsauoduasodusaod
    33.                             saldjksadjlsadlskaldhhsadlsa
    34.                         </span>
    35.                     </div>
    36. .......

    CSS for that portion:
    css Code:
    1. /* other css here... */
    2.  
    3. #abcechat #inside #mid #chatwrapper
    4. {
    5.     width: 647px;
    6.     height: 460px;
    7.     overflow:auto;
    8.     /*border: 1px solid black;*/
    9. }
    10.  
    11. #abcechat #inside #mid #chatwrapper .chatbox
    12. {
    13.     background: url(images/chatbox_back.png) repeat-x;
    14.    
    15.     min-height: 47px;
    16.    
    17.     /*border: 1px solid black;*/
    18.    
    19.    
    20.    
    21. }
    22.  
    23. #abcechat #inside #mid #chatwrapper .chatbox .avatar
    24. {
    25.    
    26.     float:left;
    27.     margin:0px;
    28.    
    29.     background: url(images/avatar_back.png) no-repeat;
    30.     width: 50px;
    31.     height: 50px;
    32.    
    33.     /*border: 1px solid black;*/
    34.    
    35.    
    36. }
    37.  
    38. #abcechat #inside #mid #chatwrapper .chatbox .avatar img
    39. {
    40.     width:33px;
    41.     height:33px;
    42.    
    43.     margin-top:8px;
    44.    
    45. }
    46.  
    47. #abcechat #inside #mid #chatwrapper .chatbox .chat_date
    48. {
    49.     float:left;
    50.     padding: 1px 0px 0px 3px;
    51.     display:inline;
    52.     font-size: 10px;
    53.     color: #088ffd;
    54.     clear:right;
    55.     height:12px;
    56.    
    57.     border: 1px solid black;
    58. }
    59.  
    60. #abcechat #inside #mid #chatwrapper .chatbox .chat_msg
    61. {
    62.  
    63.     padding: 2px 0px 0px 3px;
    64.     float:left;
    65.     font-size: 12px;
    66.     color: #5f5f5f;
    67.    
    68.     border: 1px solid black;
    69. }
    70.  
    71.  
    72.  
    73. .clear_l
    74. {
    75.     clear:left;
    76. }
    77. .clear_r
    78. {
    79.     clear:left;
    80. }
    81. .clear
    82. {
    83.     clear: both;
    84. }

    Attached Images Attached Images  

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width