Jump to content

help using css with textarea


chiefrokka

Recommended Posts

b.Messages {

font-family: Arial, Helvetica, sans-serif;

font-size: 12px;

color: #99999;

text-decoration: none;

background-color: #CCFFFF;

background-position: left;

}

 

how do I put the Name in bold, then do a carriage return, display message, then carriage return.  All the <br> show up in the textarea.  Also, how do i left justify it?  it's showing up centered.  i can use css to change color and bold and all that but it does the whole textarea text. 

 

<textarea name="Threads" class="Messages" id="Threads" cols="100" rows="3" disabled>

        <?

         // All Messages will go here

        $result = mysql_query("SELECT * FROM Messages ") or die(mysql_error());

while ($row = mysql_fetch_array($result))

{

      echo "".$row['Name']." | ".$row['Date']."";

      echo "".$row['Message']."";

      echo "------------------------------------------------";

}

?>

</textarea>

Link to comment
Share on other sites

it's just a little mini message board I want to display.  I have a little Submit Message text field under it that people can easily send messages.  I just want a little small area on top right of my page that displays all the messages.  it's not like vbullet, it's more like yahoo fantasy has in their "matchups" section that the league can post messages to

Link to comment
Share on other sites

To achieve the design you post in your message here. You'd do this

<table border="0" cellspacing="1" cellpadding="5">
<?php
// All Messages will go here
$result = mysql_query("SELECT * FROM Messages ") or die(mysql_error());
while ($row = mysql_fetch_array($result))
{
    echo <<<HTML
    <tr>
        <td><b>Name:</b> {$row['Name']}</td>
        <td><b>Date:</b> {$row['Date']}</td>
    </tr>
    <tr>
        <td colspan="2">{$row['Message']}</td>
    </tr>
HTML;
}
?>
</table>

Link to comment
Share on other sites

ok cool.  I got it to work.  I used that example code but change the "div" to "p" because I didn't want all my div to scroll throughout my code and I rarely use <p> so I just used that tag with yours and it now scrolls.  thanks! 

 

<style type="text/css">

p

{

background-color:#00FFFF;

width:350px;

height:150px;

overflow: scroll

}

</style>

</head>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.