Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3303208
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:55:59+00:00 2026-05-17T20:55:59+00:00

<!DOCTYPE html> <html> <head> </head> <body> <div style=background-color:#f09;> <textarea></textarea> </div> </body> </html> Result in

  • 0
 <!DOCTYPE html>
 <html> 
 <head>
 </head>
 <body>
      <div style="background-color:#f09;">
           <textarea></textarea>
      </div>
 </body>
 </html>

Result in Chrome:

removed dead ImageShack link

Result in FF:

removed dead ImageShack link

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T20:56:00+00:00Added an answer on May 17, 2026 at 8:56 pm

    Try display:block on the textarea:

     <!DOCTYPE html>
     <html> 
     <head>
          <style type="text/css">
               textarea {display:block;}
          </style>
     </head>
     <body>
          <div style="background-color:#f09;">
               <textarea></textarea>
          </div>
     </body>
     </html>
    

    The issue is that the textarea is inline and it is using the text height to add a bit of extra padding. You can also specify:

     <!DOCTYPE html>
     <html> 
     <head>
     </head>
     <body>
          <div style="background-color:#f09;line-height:0px;font-size:1px;">
               <textarea></textarea>
          </div>
     </body>
     </html>
    

    Another option which is helpful if you want to keep the textarea inline and don’t want to mess with the parent block’s font properties (I suggest this over the previous method with line-height):

     <!DOCTYPE html>
     <html> 
     <head>
          <style type="text/css">
               textarea {vertical-align:middle;}
          </style>
     </head>
     <body>
          <div style="background-color:#f09;">
               <textarea></textarea>
          </div>
     </body>
     </html>
    

    Finally, if you’re really worried about consistency between browsers keep in mind margins and other things like that can be defined with different defaults in different browsers. Utilizing something like YUI-Reset can help bring all new browsers to a consistent standard from which you can build.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

take a look at it -> the page (simulated). <!doctype html> <html> <head> <style
I have the following HTML <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html
I have an aspx page with 1 table containing 2 rows: <!DOCTYPE html PUBLIC
I have the following webform: <%@ Page Language=C# AutoEventWireup=true CodeBehind=Default.aspx.cs Inherits=TestWebApp.Default %> <!DOCTYPE html
I am testing against the following test document: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE html PUBLIC
I'm specifying my doctype as xhtml strict, but it's being sent over the wire
What is DOCTYPE and why do I want to use it? What are the
I set the margin of div#hdesign to margin:0px 250px to put it to the
I would like to position a div at the bottom of the page in
I have a bug in IE8, but works in firefox, chrome and safari. Here's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.