Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Left Align Text In Text Area

Tags:

html

css

I can not figure out how to do this, here is my syntax, but is leaving text centered in the text area.

<textarea name="mytextarea" cols="50" rows="5" style="align-content:center; overflow:auto; border:6px outset #000000;" >
    Doggie: 100 - 94
    Cat:    93 - 74
    Apple:  73 - 50
    Orange: 49 - 0
    </textarea>

EDIT

This is my full code and a screenshot of what it looks like when I run it:

%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <textarea name="mytextarea" cols="50" rows="5" style="text-align:left; overflow:auto; border:6px outset #000000;" >
            Doggie: 100 - 94
            Cat:    93 - 74
            Apple:  73 - 50
            Orange: 49 - 0
        </textarea>    
    </form>
</body>
</html>

EDIT 2

This is screenshot of what it looks like in my browswer enter image description here enter image description here

like image 662
RedLight GreenLight Avatar asked Feb 07 '26 11:02

RedLight GreenLight


2 Answers

It seems the textarea is white space sensitive, try removing the white spaces like in this example

<textarea name="mytextarea" cols="50" rows="5" style="align-content:center; overflow:auto; border:6px outset #000000;" >
Doggie: 100 - 94
Cat:    93 - 74
Apple:  73 - 50
Orange: 49 - 0
    </textarea>
like image 133
Collins Abitekaniza Avatar answered Feb 09 '26 01:02

Collins Abitekaniza


Change align-content:center to text-align:left

Or you can just add text-align:left and see if that works.

like image 36
wmeade Avatar answered Feb 08 '26 23:02

wmeade



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!