Results 1 to 8 of 8

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

  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,...

  2. #2

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

    Re: Problem with css - can't align the text

    Ok... I have somewhat resolved the problem.

    What I did is, used inline display for the date and then for chat_msg, I used a relative positioning and enclosed the msg in <p> tag. And have done some minor adjustments.

    So far, it's working good in Google Chrome and Firefox.

    I have attached the screenshot that I took while testing my chat. Since my exams starts after 4 days, none of my friends were online. So, I tried chatting myself.

    Attached Images Attached Images  
    Last edited by akhileshbc; Oct 28th, 2011 at 03:56 AM. Reason: grammar mistake :D

    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,...

  3. #3
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

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

    Good luck with the exam! Hope you don't develop multi-personalities...

  4. #4

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

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

    Quote Originally Posted by Justa Lol View Post
    Good luck with the exam! Hope you don't develop multi-personalities...


    Thanks

    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,...

  5. #5
    Hyperactive Member Aash's Avatar
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    491

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

    hey Akhilesh, best of luck for exams

  6. #6

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

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

    Quote Originally Posted by Aash View Post
    hey Akhilesh, best of luck for exams
    Thanks

    I have attached a screenshot of my chat application(with new look). Some of my friends tested it too and it seems going good.

    I used PHP+mySql+jQuery.
    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,...

  7. #7
    Hyperactive Member Aash's Avatar
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    491

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

    Quote Originally Posted by akhileshbc View Post

    I have attached a screenshot of my chat application(with new look). Some of my friends tested it too and it seems going good.

    I used PHP+mySql+jQuery.
    well done, it's awesome

  8. #8

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

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

    Quote Originally Posted by Aash View Post
    well done, it's awesome
    Thanks

    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