Making ASP.NET textbox wider to fit entire row using bootstrap css

This is my first time working with ASP.NET and I must admit, my HTML skills are still pretty basic. Currently, I am using the Bootstrap grid system to create a form that follows this structure:

        <div class="container">
        <div class="row dataPanel">

        <h4><b>1.First question goes here</b></h4>

        <div class="col-lg-12">
            <asp:RadioButtonList ID="q1Score" CssClass="radioButtonList" runat="server" RepeatDirection="Horizontal">
                <asp:ListItem Value="1">1</asp:ListItem>
                <asp:ListItem Value="2">2</asp:ListItem>
                <asp:ListItem Value="3">3</asp:ListItem>
                <asp:ListItem Value="4">4</asp:ListItem>
                <asp:ListItem Value="-1">N/A</asp:ListItem>
            </asp:RadioButtonList>

            <br />
            Comments:
            <asp:TextBox ID="q1CommentBox" TextMode="MultiLine" CssClass="commentBox" runat="server" />

        </div>
    </div>
    </div>

The custom CSS I have created for this form includes the following styles:

.radioButtonList label {
width: 25px;
margin-right: 15px;
margin-left: 2px;
display: compact;
font-size: 10pt;
text-align: center;
}


.commentBox {
border-style: solid;
border-color: dimgray;
width: 100%;
height:50%;
}

.dataPanel {
border: solid;
border-radius: 4px;
border-width: 1.5px;
padding: 20px;
}

Despite trying to wrap the comment box in a div with col-12-lg or row styling, I am having trouble getting it to expand the width of the row. In Bootstrap terms, this should be equivalent to occupying 12 columns, right?

Does anyone have any suggestions on how to resolve this issue?

Answer №1

When using an ASP textbox, it generates a HTML input box. These are considered inline elements, so if you want it to span the entire width of its container, you will need to set the width to 100%.

#q1CommentBox{
  width: 100%;
}

I trust this information is useful for you.

Answer №2

I want to give a shoutout to TidyDev and VDWWD for pointing me in the right direction. As I was constructing the page and examining the textarea element, I noticed a peculiar style class being applied:

input, select, textarea {
     max-width: 280px;
}

This particular class was restricting the width of my text. Strangely enough, it wasn't included in any of the bootstrap stylesheets or other project attachments. To solve this issue, I decided to add the class to my custom stylesheet and make some adjustments - problem solved!

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

What is the best way to center a SVG and a span vertically within an inline unordered list?

My <ul> element contains 2 <li> items with styling using display: inline-block. Unfortunately, the SVG and text inside each <li> are not vertically aligned. I attempted to use vertically-align: middle since they're both inline-block ...

Using Ajax to create interconnected dropdown lists in an ASP.NET application

I am currently working with 2 dropdown lists, named ddl_customername and ddl_customercode. In addition, I have a SQL datasource called sqldatasource1 that retrieves data from tbl_customers table (select customername, customercode from tbl_customers). My ...

Animating a spinning SVG path around its center within a larger rectangular box

Is there a way to rotate a smaller SVG path within a larger rectangle around its own center? The current code rotates the entire space. <animateTransform attributeType="xml" attributeName="transform" type="rotat ...

What is the rationale behind browsers on OSX not supporting the styling of HTML option elements?

As an OSX user, I primarily use Chrome and recently discovered that styling the HTML option element is not applied in any browser (Chrome, Firefox, Safari) on OSX. // HTML <select> <option class="option">Value 1</option> < ...

"Identifying elements in CSS that do not have any adjacent text elements

I need help identifying a CSS selector that can differentiate between the <var> tags in these two distinct situations: <p><var>Foo</var></p> And <p>Some text <var>Foo</var> and more text</p> Specifi ...

Is it possible to modify or delete the question mark in a URL?

Currently, I am working on implementing a search bar for one of my websites hosted on Github. Below is the code I have written for the search bar: <!-- HTML for SEARCH BAR --> <div id="header"> <form id="newsearch" method ...

Exciting effects activated by hovering on a button

I'm attempting to create an animated effect by having a rectangle expand over the button when hovered by the user. However, I am unsure how to achieve this and have hit a roadblock. Here's what I want: There's a button. There's a rect ...

Finding the Location of the Parent Page within an iFrame

When attempting to retrieve the Parent screen position using the code below, I am consistently receiving a value of 0: window.parent.$(document).scrollTop() ...

Dropdown navigation with CSS

It seems like there's a simple oversight on my end... The drop-down menu I created is causing the main navigation bar to expand. You can view the page I'm working on by following this link. The issue occurs with the navigation below the App butto ...

Unable to consistently select a radio button via code across different browsers

Is there a way to automatically select a radio button based on the URL path? $(document).ready(function () { function checkRadioBasedOnUrl() { var urlPath = window.location.pathname.split("/"); console.log(urlPath); // ["", "tradeshow ...

Keep table header stationary while accommodating varying column widths

I have come across various solutions for freezing a table header row, such as creating a separate table containing only the header and hiding the header of the main table. However, these solutions are limited to cases where column widths are predetermine ...

Tips for ensuring the middle row remains sandwiched between the header and footer rows in Bootstrap

After adding styles for img with max-height:100% and max-width:100%, the display looked fine with just images. However, upon further inspection, I noticed that if the middle row (which can contain one or two columns side by side) has multiple images or an ...

collapsed navbar issue in Bootstrap 4

The Navbar-toggle button was initially located on the top-right in both web and mobile modes. However, when the navbar collapsed in mobile mode, something went wrong (refer to the last image). I believe that the issue lies within the order of lines in my ...

Using a jQuery if statement to target a particular div and apply custom CSS styling

I have encountered a unique challenge that I am struggling to solve. Imagine I have a 3x3 table created using div elements, and one of the cells has a background color of #999. My goal is to use jQuery to check if a specific cell has this background color, ...

How can I prevent my mouse click from being overridden by my mouse hover?

Currently, I am developing a Sudoku game using JavaScript and facing some challenges with mouse events. My goal is to enable users to hover over a square and have it change color, as well as click on a square to highlight the entire row, column, and quadra ...

Unable to display image on React page using relative file path from JSON data

Greetings, this is my initial post so please forgive me if I have missed any important information. I'm currently in the process of creating a webpage using react. My goal is to display content on the page by iterating over a relatively straightforwa ...

Steps for aligning an image and text within an icon next to each other

I'm looking to align a small PNG image next to some text within an icon. How can I achieve this? Currently, they are stacked vertically. Here is the current layout - I want the two elements side by side instead. The structure of the division is unique ...

Experiencing strange behavior with floating labels in Bootstrap 5.3 on my Google Chrome browser (Version 123.0.6312.86 (Official Build) (64-bit))

Lately, I've observed an unusual behavior with BS 5.3 floating labels. Strangely, the placeholder is being displayed below the label text, which is not the expected behavior. On Google Chrome, the floating labels are appearing like this: https://i.ss ...

Attempting to apply custom styles to jQuery components using CSS

Looking to restyle the black bar on my test page located at The black bar with 3 tabs about halfway down the page needs a new color scheme. By inspecting with FireBug, I found these elements: <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ...

Laravel - Unauthorized access to array index

I am trying to change the color of a table cell in Laravel based on its content, but I keep encountering this error: "Illegal string offset 'Disponible' (View: C:\Users\RAYLAN\Documents\CRMSAV\resources\vie ...