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 8204597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:56:48+00:00 2026-06-07T07:56:48+00:00

I’ve been playing with responsive layout and forms. I’m quite pleased with what I

  • 0

I’ve been playing with responsive layout and forms. I’m quite pleased with what I have so far: it works nicely from mobile to wide screen; see below. (Only tested on firefox/chrome so far.)

At the 800px width it moves the message block to the right column. The problem is that this is done with a float:right and position:absolute, which means its height stops affecting the surrounding div. So the message box sticks out.

I can (and do) improve this by adding the height:220px, so that it looks okay by default. But someone can still resize the textarea outside of the surrounding div. I find resizing textareas a wonderful feature, so don’t want to disallow the resizing. And overflow:auto is not a solution: the user would just be exchanging scrollbars on the textarea for scrollbars on the div!

So, is there any way to have the outer div resize to always contain the textarea?

<html>
<head>
<style>
body{background:#fff;font-family:FreeSerif, serif;font-size:16px;margin: 0 0 0 0;}

#contactform {margin: 0 auto;width:90%;max-width:320px;border:1px #000 solid;border-radius:8px;padding:6px;}
#contactform .required:after{color:red;content:" *";}
#contactform label {display:block;}
#contactform textarea {height:120px;rows:5;min-width:90%;max-width:90%;}
#contactform input,textarea {border: 1px solid red;border-radius:8px;width:90%;height:26px;padding:2px 4px;font-family:sans;}

@media (min-width: 800px) {
#contactform {margin: 0 auto;width:640px;max-width:640px;position:relative;/*height:220px;*/}
#formsecondhalf {top:0;right:6px;position:absolute;}
#contactform textarea {height:200px;rows:8;min-height:200px;min-width:300px;max-width:300px;}
#contactform input,textarea {width: 300px;min-width:300px;max-width:300px;}
}

</style>
</head>
<body>
<div id="contactform">
<form action="" method="post">
<label for="name" class="required">Name:</label>
<input id="name">
<br/>
<label for="email" class="required">Email:</label>
<input id="email">
<br/>
<div id="formsecondhalf">
<label for="message">Message:</label>
<textarea id="message"></textarea>
</div>
<br />
<input type="submit" value="SEND">
</form>
</div>
</body>
</html>
  • 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-06-07T07:56:49+00:00Added an answer on June 7, 2026 at 7:56 am

    Use float:right instead of absolutely positioning the right area. And then wrap a div around the other fields, float that left, and then just clear it all.

    Example

    <html>
        <head>
            <style>
                body{background:#fff;font-family:FreeSerif, serif;font-size:16px;margin: 0 0 0 0;}
    
                #contactform {margin: 0 auto;overflow:auto;width:90%;max-width:320px;border:1px #000 solid;border-radius:8px;padding:6px;}
                #contactform .required:after{color:red;content:" *";}
                #contactform label {display:block;}
                #contactform textarea {height:120px;rows:5;min-width:90%;max-width:90%;}
                #contactform input,textarea {border: 1px solid red;border-radius:8px;width:90%;height:26px;padding:2px 4px;font-family:sans;}
    
                @media (min-width: 800px) {
                    #contactform {margin: 0 auto;width:640px;max-width:640px;position:relative;/*height:220px;*/}
                    #formsecondhalf {float:right;}
                    #formfirsthalf {float:left;}
                    #contactform textarea {height:200px;rows:8;min-height:200px;min-width:300px;max-width:300px;}
                    #contactform input,textarea {width: 300px;min-width:300px;max-width:300px;}
                }
    
            </style>
        </head>
        <body>
            <div id="contactform">
                <div id="formfirsthalf">
                    <form action="" method="post">
                        <label for="name" class="required">Name:</label>
                        <input id="name">
                        <br/>
                        <label for="email" class="required">Email:</label>
                        <input id="email">
                        <br/>
                </div>
                <div id="formsecondhalf">
                    <label for="message">Message:</label>
                    <textarea id="message"></textarea>
                </div>
                <br />
                <input type="submit" value="SEND">
                    </form>
            </div>
        </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a text area in my form which accepts all possible characters from
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

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.