Utilize Bootstrap for EF Core pages with pre-designed scaffolds - text will remain neatly displayed within textbox without the need for inline CSS word-wrap styling

After generating CRUD pages using EF core, I am now attempting to make edits to one of the cshtml files. The default Bootstrap CSS file that I am using includes various CSS class definitions:

.row {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col-md-4 {
    -ms-flex: 0 0 33.333333%;
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.form-group {
  margin-bottom: 1rem;
  font-size: 200px;
}

.form-control {
  display: block;
  width: 100%;
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;  
}

There is a specific text box or element within the code which I anticipate will contain multiple sentences of text. This particular element is nested inside other elements as shown below:

<div class="row">
  <div class="col-md-4">
    <div class="form-group">
      <label asp-for="ChangeSummary" class="control-label"></label>
      <input asp-for="ChangeSummary" class="form-control" style="height: 200px; width: 200px; word-wrap: break-word"/>
      <span asp-validation-for="ChangeSummary" class="text-danger"></span>
    </div>
  </div>
</div>

My expectation is that the inline CSS should take precedence over any styles applied from an external CSS file. However, the actual presentation of the textbox does not meet my desired layout.

https://i.sstatic.net/g2y1S.png

I aim for the text within the textbox to align at the top and wrap downwards, similar to the following image:

https://i.sstatic.net/WQJsy.png

Could you provide any insights on what might be causing this issue?

Answer №1

After conducting a search using the right keywords, I finally stumbled upon the solution here:

How to wrap text inside an input type="text" element in HTML/CSS

It turns out that "input" elements are not designed to handle text wrapping like this. The correct approach is to use the "textarea" element instead.

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

Issues encountered when using Vue Transition in conjunction with v-autocomplete

Attempting to conditionally display or hide a selection text field using Vue's Transition feature, but experiencing an issue where the text field appears and disappears without any transition effect. <template> <Transition v-if="is ...

Is there a way to position the text within an email body at the center using SendGrid?

I've been working on creating an email newsletter template using SendGrid, and I've run into a formatting issue where the content doesn't align properly in the email body. The image below shows how it's appearing incorrectly. Does anyon ...

CSS: Adding decorative trailing dots below the header when positioned over a background

I am seeking assistance with achieving a specific effect in CSS, as shown in the attached screenshot. The trailing dots should cover the entire width of the element (100%) and be responsive. However, I encountered an issue when placing the header on a bac ...

The accordion won't function properly if it is added using append() after the document is ready

I have implemented a button to add an accordion, but unfortunately it doesn't seem to be working properly. I am unsure of how to troubleshoot and resolve this issue. If the accordion HTML is appended after the document.ready() function, then the accor ...

Is there a skilled coder available to troubleshoot this carousel's HTML code?

Hello, I am struggling with the code snippet below that uses Bootstrap to create a carousel. The next and previous buttons are not working properly. <div id="testimonial-carousel" class="carousel slide" data-ride="carousel&qu ...

Ways to eliminate header and footer data while printing a webpage

In my attempt to implement the code displayed below, I am encountering an issue where the header and footer continue to appear on the printed page. Despite numerous attempts with various CSS elements, I have been unsuccessful in removing the header and fo ...

How can you change a particular inline style using the Firefox browser?

I am looking for a solution to override an inline style on a specific webpage within the Firefox browser without access to the source code. Previously, I would manually modify the page source using Firefox development tools. Specifically, I encounter a we ...

The CSS transition feature does not seem to be functioning properly when it comes to displaying

In my Next.js application, I am using a card component with a "read more" link that should expand the card when clicked. To achieve this behavior, I integrated the "react-show-more" library from https://github.com/One-com/react-show-more. I tried to add ...

Issue with Bootstrap carousel - the carousel.on method is not recognized

I have implemented a standard Bootstrap carousel in my project: <div id="myCarousel" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"> ...

Tips for automatically breaking or paginating HTML in order to ensure that the resulting PDF mirrors the paginated HTML layout

I'm looking to implement a feature that automatically breaks or paginates HTML content in order to ensure that the resulting PDF matches the appearance of the original HTML. Requirement: If HTML content exceeds the size of an A4 paper, it should be s ...

Adjustable fixed <h1> does not match background pattern dimensions

Having trouble positioning images and text on your website? When the screen size is minimized, the proportionality of the elements is lost. You've tried using an image for the text, which worked, but now you're struggling to do the same with actu ...

Implementing compatibility for IE11 in a plugin that utilizes CSS3 features

I have currently integrated a plugin on my website from the following source: http://tympanus.net/Tutorials/3DRestaurantMenu/ The plugin works smoothly on most browsers, except for IE11. In IE9 and earlier versions, it displays as a 2D menu, losing the CS ...

Is there a way to verify that all CSS files have been successfully downloaded before injecting HTML with JavaScript?

I am looking to dynamically inject HTML content and CSS URLs using JavaScript. I have more than 3 CSS files that need to be downloaded before the content can be displayed on the page. Is there a way to check if the aforementioned CSS files have finished ...

Explanation: The information box does not appear when the mouse hovers over it

Welcome to the gallery showcasing a unique calendar design with tooltip functionality. This calendar features a special hover effect for New Year's Day on January 1st, displaying a tooltip text upon interaction. Feel free to explore the code below to ...

Unable to utilize CSS filter property in Internet Explorer 10

I am trying to add a CSS filter to the body tag. I have applied the following CSS rules and created a JS Fiddle with the styles - JS fiddle with CSS styles The filter works well in Chrome, Firefox, and Opera, but it doesn't seem to apply in Internet ...

Switch the class of a div using jQuery when it is clicked

I need to implement functionality where 4 different links change the class of a specific div when clicked. For example, clicking on link 1 will change the class to s1, link 2 to s2, and so on. Below is some code that I have been working on, however, I am ...

Bespoke design for your ReactJS project

As I delve into my personal project with React generated by create-react-app, I find myself faced with a style guide filled with specifications for font-family, primary colors, stylish buttons, icons, and various custom components such as check-boxes and i ...

The functionality of dropdown menus in the Bootstrap 5 navbar is currently experiencing issues

I recently updated my Bootstrap from v5.2.2 to v5.2.3 and now the dropdown menus in my navbar are not working properly. They do not drop down as they should, instead, they remain stationary. Can someone please help me figure out what I am doing wrong? & ...

Is there a way to rearrange my divs in the mobile display?

Is there a way to make the image column stack below the text info column in mobile view? I've tried using flexbox without success, so any help would be greatly appreciated. Thank you! <div class="container"> <div class="row"> ...

The column headers in the Kendo grid fail to resize proportionally

The column headers in the Kendo grid do not scale correctly when the browser has a large or small resolution. This issue can be easily reproduced by zooming in or out on the browser. Refer to the image below for an example. Is this a known bug, and are th ...