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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:36:13+00:00 2026-06-12T08:36:13+00:00

I have a form with a textarea where users can write some code. I’m

  • 0

I have a form with a textarea where users can write some code. I’m replacing that textarea with a CodeMirror code editor box, so I want to apply Bootstrap stylings to it.

This is what the form looks like right now, where all the form elements except the code editor have Bootstrap stylings: enter image description here

So in particular, I think I need to give the code editor rounded corners, a border, the correct width (input-xxlarge), and blue highlights when mousing over.

How do I do this? Is there a way of doing this besides manually copying over the necessary CSS?

UPDATE

I tried copying over the textarea CSS from Bootstrap, and all looks good except the focus CSS when I click inside the code editor. This is what I get:

enter image description here

The highlight is on the inside, instead of the outside. Any ideas how I fix this?

This is the CSS I added by copying from Bootstrap:

    .CodeMirror {
      line-height: 1.3em;
      font-family: monospace;

      /* Necessary so the scrollbar can be absolutely positioned within the wrapper on Lion. */
      position: relative;
      /* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */
      overflow: hidden;
      background-color: white;
      width: 530px;

      /* Copied from Bootstrap's textarea */
      display: inline-block;
      padding: 4px 6px;
      margin-bottom: 9px;
      color: #555555;
      border: 1px solid #ccc;
      -webkit-border-radius: 3px;
      -moz-border-radius: 3px;
      border-radius: 3px;
      -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
      -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
      box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
      -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
      -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
      -ms-transition: border linear 0.2s, box-shadow linear 0.2s;
      -o-transition: border linear 0.2s, box-shadow linear 0.2s;
      transition: border linear 0.2s, box-shadow linear 0.2s;  
    }

    .CodeMirror-focused {
      /* Copied from Bootstrap's textarea */
      border-color: rgba(82, 168, 236, 0.8);
      outline: 0;
      outline: thin dotted \9;
      /* IE6-9 */

      -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
         -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
              box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);  
    }
  • 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-12T08:36:15+00:00Added an answer on June 12, 2026 at 8:36 am

    CodeMirror hides the original textarea and creates a (fairly complex) structure of div and pre elements. You can style the outermost div which has a class of .CodeMirror to achieve the same effect.

    This will require customizing the CodeMirror stylesheet or adding your own style for the class/element. If you are building Bootstrap using LESS, there may be a way to apply a mixin to avoid duplicating the textarea style, though the amount of duplication is probably minimal.

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

Sidebar

Related Questions

I have a form with a textarea that can contain large amounts of content
I have a textarea and users can type in it. I want to store
Here's my problem. I have a textarea in my form, where users can submit
I have a site that has a form that I want users to be
I have an issue where i have a textarea in a form where users
Assuming we have a comment textarea where the user can enter this code: [quote=comment-1]
i have html form with textarea in which i paste some XML, for example:
On my page I have a textarea where users can enter a list of
On the site I am developing, I have a file input that users can
I have been struggling to create a django form which users can fill and

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.