Tips for customizing the appearance of a textarea to resemble an input field

I'm having trouble with formatting a textarea using Bootstrap 4 CSS.

I've been trying to adjust the styling myself, but whenever I add padding or margin it makes the textarea height too large.

.comment-box {
  padding: 0.8rem 1rem;
  border-radius: 30px;
}
<textarea class="form-control comment-box" rows="1"></textarea>

I'd like the textarea to resemble an input field with a button inside it, similar to this image:

Click here for example

Answer №1

Visit this link for a detailed guide on how to override bootstrap styles. By following these steps, you should be able to successfully resolve the issue at hand.

Additionally, it's worth noting that you can skip the first and second steps mentioned in the explanation. Simply focus on the third step to create a new style that will override the default bootstrap styling.

Answer №2

For more information on creating a contact form using CSS, you can visit this helpful link:

To address your issue, I recommend studying the CSS styles used in the example and experimenting with them to see how they work.

input[type="text"],
select,
textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  margin-top: 6px;
  margin-bottom: 10px;
}

input[type="submit"] {
  border: none;
  background: #4aaaa5;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  color: #ffffff;
  font-size: 16px;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Guide to consistently displaying buttons in the bottom-left corner (using ASP.NET Core and Bootstrap)

Looking for help on how to always display two navigation buttons at the bottom left-hand side of my ASP.NET Core Web app, which enable search result navigation. Any suggestions on an easy way to achieve this? Check out the image referenced below. https:// ...

Is there a way to customize the appearance of a clicked link using only CSS?

Is it possible to style a clicked link using only CSS in order to provide user feedback that the link has been clicked and is taking the desired action? While I could use JavaScript to listen for click events and apply a desired class for feedback, a CSS- ...

Is there a way to program custom key assignments for my calculator using JavaScript?

As a beginner in the world of coding and JavaScript, I decided to challenge myself by creating a calculator. It's been going smoothly up until this point: My inquiry is centered around incorporating keys into my calculator functionality. Currently, th ...

Pass a data variable to an HTML file using express's sendfile function (quick inquiry)

Currently utilizing Node.JS, path, and express for running an HTML webpage. I need to pass a variable to the HTML file for its utilization: var client_cred_access_token = 'fakeToken'; ... app.get('/', function (req, res) { res.se ...

What is the best way to create a blurred effect on an image during loading, and then transition to a sharp image once it is fully loaded?

I'm currently working on a project where I want the images to display as a blurred preview initially, and then become clear once fully loaded. This is similar to the feature seen on Instagram, where the app shows a blurred image before displaying the ...

Utilizing conditional statements and time to dynamically alter the class of an object

I need to change the class of an object based on the time, with two classes available: recommendedspot and notrecommended. The code I've written so far is not displaying the image correctly. Can someone help me troubleshoot this issue? Here is my cur ...

Ways to troubleshoot an unusual margin issue in a static column of an HTML table

I have been exploring various resources to create an HTML table with a fixed first column using CSS only. Despite my efforts, the fixed column is consistently appearing lower than the rest of the content, and I'm unsure why. Check out the code I&apos ...

Develop a fresh AngularJS directive that utilizes the HTML5 audio element

Recently delved into Angular and managed to create audio buttons using an Angular directive: app.directive('soundButton', [function () { return { restrict: 'E', link: function (scope, element, attrs) { v ...

Incorporating a PHP script into an HTML document for display

I have a PHP file that retrieves line items from a database and displays them in a table. On an HTML page, I have a form for adding items to the database that houses a restaurant menu. I want to embed the PHP script responsible for showing the line items i ...

Is there a mistake in the way I am creating a horizontal navigation bar?

Currently working on creating a simple navigation bar using HTML/CSS for a Java/Spring Boot project. Admittedly, my HTML/CSS skills are quite limited as you can see below. I'm aware that there might be some mistakes in my approach. Thank you in advanc ...

Steps to showcase an image from MongoDB in HTML using Java with Spring Boot

My current task involves displaying an image based on the unique identifier obtained from the FindById() method. I have successfully retrieved the image data from MongoDB through a Rest Call, but now I need to show this image to the user in a web browser u ...

Retrieve data from the database using the information provided earlier

In my salary adding form, I am faced with the task of manually entering the rates for morning and night shifts for each company. Since every company has different rates, I would like to streamline this process by automatically retrieving the rates from t ...

The overflow:hidden feature is ineffective in Firefox, yet functions properly in both IE and Chrome browsers

I'm in the process of creating a webshop and facing an issue with my sidebar due to varying product counts on different pages. For now, I have implemented the following workaround: padding-bottom: 5000px; margin-bottom: -5000px; overflow: ...

Are there any resources for finding react templates that are reminiscent of bootstrap templates?

Just starting out in the world of web development, I've taken the time to learn the fundamentals of react. However, I'm now searching for react templates that come in component form, allowing me to easily modify content and possibly add additiona ...

Issue with Firefox position: absolute not producing the desired outcome

I am working on a webpage where I want to put a label over an image. I was able to achieve this using position: absolute for the label and float: left for the img tag. This method worked perfectly in most browsers, except for Firefox (both version 3 and 4) ...

How to use the HTMLParser library in Java to extract the content of a title tag

Attempting to fetch text content in the title tag from Google's webpage using Java, but encountering issues with the output. Despite a successful build, the output only shows "TITLE" instead of "GOOGLE". Here is the code snippet: import org.htmlpars ...

Is it possible to create various HTML elements from JSON data using JQuery?

Is there a way to utilize Jquery and Javascript to extract JSON data from $ajax and then iterate through it using a foreach loop, in order to create a string that can be appended to the HTML DOM? For example: $(document).ready(function (e) { $.ajax({ ...

What is the best way to allow a number to be editable when clicked on in a React application

Currently, I am trying to find a solution for making a number editable when clicked without having to use form inputs or other React libraries that don't fit my requirements. The provided screenshots showcase the desired interface. https://i.stack.im ...

Instructions for transferring information from a JSON column in a MySQL database to an HTML table generated using a PHP foreach loop

I have been working on developing a web application that is connected to a MySQL database all by myself. One of the columns in the database is in JSON format, and I recently implemented it. Here's an example of one row from that column: Column Name: ...

Initiating the concealment of the parent element causes a disruption in the formatting of the child element when utilizing Bootstrap 4

When attempting to add a class to a parent DIV that affects multiple inner elements, issues with styling arise when using Bootstrap. The problem is demonstrated in the code snippet below, where the bottom border appears misaligned on element 2. Simply tog ...