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

  • SEARCH
  • Home
  • 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 7516145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:02:36+00:00 2026-05-30T01:02:36+00:00

So I dont know exactly how to ask what I am looking for so

  • 0

So I dont know exactly how to ask what I am looking for so I might just post pictures.

I have this box of which it contains of 2 divs next to each other. Div with border-right and the content div:

enter image description here

and here is the HTML structure:

<div id="box">
    <div class="dblline">

    </div>
    <div contenteditable="true" class="content">
           *content goes here*
    </div>

</div>

Now as you can see, the place where the content is, is editable thus making its height expand as you type. The border-right div, has min-height so it can expand as the content area expands (?) but it doesn’t seem to work and here is question:

How can I expand the border too as the content expands so it doesnt look like this:

enter image description here

This is my CSS:

#box {width:200px;border:1px solid grey}

.dblline {border-right:3px solid rgba(0, 0, 0, .5);margin-left:15px;
 min-height:200px;position:absolute}

.content {padding:10px 20px 10px 30px ;}​

jsFiddle: http://jsfiddle.net/7tcWN/

  • 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-30T01:02:37+00:00Added an answer on May 30, 2026 at 1:02 am

    Specific solution

    This one is for browsers without Javascript. It just creates the border in the div of the text, therefore it automatically scales. Weakness: when browser highlight the box while editing they only highlight the part on the right of the vertical rule, which looks odd.

    <html><head><style>
    #box { width: 200px; border: 1px solid grey; }
    .content {
        border-left: 3px solid rgba(0, 0, 0, .5);
        padding: 10px 20px 10px 12px;
        margin-left: 15px;
        min-height: 200px;
    }​
    </style></head><body>
    <div id="box">
        <div contenteditable="true" class="content">
           *content goes here*
        </div>
    </div>
    </body></html>
    

    And now for the other one…

    Complete jQuery solution

    Unfortunately there is no change event that works with this type of editable field. I have tested other events and came up with these required three:

    • keyup – for normal typing,
    • keydown – when you press and hold a key,
    • mousemove – for drag and drop.

    Notice there’s a mousemove instead of mouseup, because text isn’t pasted yet, when the latter is triggered. You could probably get away with setTimeout on such occasion, but to keep things simple I went with mousemove. Here’s the code (with extra debug logging when you uncomment one line):

    <html><head><script src="jquery.min.js"></script><style>
    #box { width: 200px; border: 1px solid grey; }
    .dblline {
        border-right: 3px solid rgba(0, 0, 0, .5);
        margin-left: 15px;
        min-height: 220px;
        position: absolute;
    }
    .content { 
        padding: 10px 20px 10px 30px;
        min-height: 200px;
    }​
    </style><script>
    function resize_rule(msg) {
        //if (msg) console.log(msg);
        var H = $("#box .content").outerHeight();
        var h = $("#box .dblline").height();
        if (h != H) $("#box .dblline").height(H);
    }
    $(document).ready(function() {
        $("#box .content").keydown(function(){resize_rule("keydown");});
        $("#box .content").keyup(function(){resize_rule("keyup");});
        $("#box .content").mousemove(function(){resize_rule("mousemove");});
    });
    </script></head><body>
    <div id="box">
        <div class="dblline">
        </div>
        <div contenteditable="true" class="content">
               *content goes here*
        </div>
    </div>
    </body></html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know where exactly to ask this question: How can i make gameplay
I dont know where my error is in this mysql query $sql = INSERT
I don't know exactly how it happened, but I have a versioned .svn directory
I'm not exactly sure how to phrase this, but here goes... We have a
I don't even know what exactly should I ask, so I need mostly some
I think this should be releated to IIS settings but don't know exactly what
I'm not exactly sure what question to ask here since I don't know the
I don't know where to ask this question or how to ask. Basically what
I really didn't know how to ask this question in a simple fashion. I
I know that a lot of people ask this before , am using really

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.