/    Sign up×
Community /Pin to ProfileBookmark

colors in text area

Hey i was wondering if there is a way to make the backround a different color than white in a text area? I want to make it black. A text area is the only way i can think of to have and area to make updates and have its own scroll bar. Also, is there a way to change the color of the scroll bar? I cant find it on any of the html tutorials. Thanks

to post a comment
Full-stack Developer

5 Comments(s)

Copy linkTweet thisAlerts:
@CharlesFeb 25.2003 — [font=monospace]<textarea style="background-color:#000000; color:#ff0000">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</textarea>[/font]
Copy linkTweet thisAlerts:
@Robert_WellockFeb 25.2003 — There is no official way to change the scrollbar colour using CSS alone although you may be able to change the background colour.

<style type="text/css">

<!--

textarea { background-color: black; color: white; }

-->

</style>

Charles just beat me to the post.
Copy linkTweet thisAlerts:
@georgeafiauthorFeb 25.2003 — Ok thanks guys, i did a seach and found the code to change the scroll bars.

One more question though. Is there a way to get rid of the border around the text area. I plan on having the text in the text area scroll up and down in front of a picture without the picture moving if i can. if not thats cool.
Copy linkTweet thisAlerts:
@CharlesFeb 25.2003 — [font=monospace]<textarea style="border:0px; background-color:#000000; color:#ff0000">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</textarea>[/font]
Copy linkTweet thisAlerts:
@Robert_WellockFeb 26.2003 — I would like to know what exactly you were trying to achieve, if it were purely stylistic in nature you could have used CSS to create a <div> of a given dimension, which would allow scrollbars, or borders if you required them, or not for example:

<i>
</i>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;title&gt;Overflow to Scroll...&lt;/title&gt;
&lt;style
type="text/css"&gt;
&lt;!--
.auto {
border: 1px solid #ccc;
background: #f6f6f6;
height: 110px;
margin: 20px;
width: 500px;
overflow: scroll;
color: green;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div
class="auto"&gt;
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Praesent imperdiet, nunc nec cursus sagittis, diam ipsum
mattis turpis, non blandit wisi quam ut dolor. Nullam quis
leo vitae orci tristique commodo. Donec mauris elit, mollis
vel, pharetra sit amet, sodales ac, nisl. Pellentesque tempus
nisl quis sapien gravida bibendum. Integer quis libero sit
amet odio lobortis rhoncus. Ut eu lectus. Proin augue wisi,
semper quis, dictum vitae, fermentum nec, nibh. Vestibulum
scelerisque, diam sed mattis mollis, elit magna aliquam sem,
eget imperdiet felis pede at metus. Curabitur pharetra
imperdiet augue. Duis dignissim dapibus mauris. Etiam quis
quam ac nibh commodo porttitor.
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
×

Success!

Help @georgeafi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...