What steps can I take to stop text from disappearing when the screen size decreases and the span is used?

I'm currently using Bootstrap 5 to create a form.

On a computer screen, my file input element looks like this:

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

However, on mobile devices, it appears like this:

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

Below is the code snippet:

<!-- Bootstrap-5 -->
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="98faf7f7ecebeceaf9e8d8adb6a8b6aa">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">


<!-- Body -->
<div class="row justify-content-end mt-1">
  <label for="totalScore" class="col-2 me-4">Total score</label>
  <input type="text" name="totalScore" id="totalScore" class="col-1" value="0/27" readonly style="width:20%;" />
</div>
<div class="row justify-content-end mt-1">
  <label for="percent" class="col-2 me-4">Percentage achieved</label>
  <input type="text" name="percent" id="percent" class="col-1" value="0%" readonly style="width:20%;" />
</div>
<div class="row ms-3 mt-3 mb-3">
  <label for="comments" class="col-2 me-5">Comments /<br/> Observations</label>
  <textarea name="comments" id="comments" rows="1" class="col-5"></textarea>
</div>
<div class="row ms-3 mt-2 mb-2">
  <label for="checkedBy" class="col-2 me-5">Checked by</label>
  <input type="text" name="checkedBy" id="checkedBy" class="col-5" />
</div>
<div class="row ms-3 mt-2 mb-2">
  <label for="intakeQuantity" class="col-2 me-5">Intake Quantity</label>
  <input type="number" name="intakeQuantity" id="intakeQuantity" class="col-5" min="0" step="1" />
</div>
<div class="row ms-3 mt-2 mb-2">
  <label for="rejectedProduct" class="col-2 me-5">Rejected Product</label>
  <input type="number" name="rejectedProduct" id="rejectedProduct" class="col-5" min="0" step="1" />
</div>
<div class="row ms-3 mt-2 mb-2">
  <label for="processed" class="col-2 me-5">Processed</label>
  <input type="number" name="processed" id="processed" class="col-5" min="0" step="1" />
</div>
<div class="row ms-3 mt-2 mb-2 imput-group">
  <label for="photo" class="col-2 me-5">Upload Photo</label>
  <span class="input-group-text col-1">JPEG Only</span>
  <input type="file" name="photo" id="photo" class="form-control col-7" style="text-align:left;width:33.5%;height:100%;" accept="image/jpeg" />
</div>
<div class="row justify-content-center m-2">
  <input type="reset" value="Cancel" class="col-1" style="width:auto;" />
</div>
<div class="row justify-content-center m-2">
  <input type="submit" value="Submit" class="col-1" style="width:auto;" />
</div>

Any suggestions on how I can prevent the span from shrinking?

Answer №1

Attempt to include w-100 to ensure that it maintains a width of 100%

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

Troubleshooting: Ineffective use of replace() function on input value with jQuery

Visit this link for a demo How can I update the input value based on user selection in a dropdown menu? The objective is to change the value from "service_######" to "membership##_####" when the user selects YES, but my current JavaScript code using repla ...

Ensure that the div is completely filled by the button and input elements

My dilemma involves filling a div element with a button and an input field. I'm struggling to set the exact width of the button, which is causing the input field to overflow the parent container. Despite many attempts with various properties, includin ...

How can CSS image hover affect the layout of other elements on the page?

When I hover over the image and it grows to 350px, it causes everything around it to shift. The code is functioning as expected, but the issue arises when the enlarged image pushes nearby elements downward. Is there a way to prevent this behavior? #disp ...

What initiates the call for CSS?

During his instructional video, the creator visits the CodeIgniter website at . When he initially arrives at the site (at 1:32), it appears somewhat odd, almost as if it lacks CSS styling. However, after refreshing the page (1:37), it displays properly. ...

Link to text on tablet and phone

On my website, I have included a phone number in the HTML as text. When viewed on an iPad tablet, it automatically interprets the phone number and turns it into an underline blue link. Is there a way to format the phone number in a different style so it d ...

Best Practices for Implementing the 960 CSS Clear Class

I'm puzzled by the necessity of using the clear class in the 960 css framework. Every time I remove a div with the clear class, everything seems to function properly. Can you explain to me the significance and purpose behind this class? ...

Tips for using unique fonts in email text display

As I was editing a Mailer template in core php, I found myself wanting to set a custom font for the text displayed in the mail template similar to how we do it for websites using CSS and imported fonts. Below is the code snippet that I have been using: & ...

Creating a series of menu image buttons with rollover effects using HTML and CSS

I am facing an issue with my navigation bar. I have 5 horizontally aligned .png buttons that I want to add rollover effects to using CSS, not Java. After trying multiple solutions, I still can't seem to get it right. None of the methods I attempted w ...

Guide on setting the value of a select element in Vue Core UI

Apologies for the newbie question, as I am just starting out with Vue.js. I have recently started using CoreUI, but I am having trouble finding detailed documentation or tutorials on CoreUI+Vue integration. Specifically, I am working with the <CForm> ...

Unable to output value in console using eventListener

Hey everyone, I'm new to JavaScript and trying to deepen my understanding of it. Currently, I am working on an 8 ball project where I want to display the prediction in the console. However, I keep getting an 'undefined' message. const predi ...

Semantic UI Troubles: Unraveling the Sidebars and #pusher Defects

Hey there, I could really use some assistance with an issue I'm facing. I have this particular structure that's causing me trouble. <div id="toolbar" class="toolbar overlay-displace-top clearfix toolbar-processed"> ... </div> < ...

Display the HTML content retrieved from the SailsJS Controller

Exploring the world of SailsJS, I am on a mission to save HTML content in a database, retrieve it, and display it as rendered HTML. To achieve this goal, I have set up a sails model and a controller. This is what my model looks like: attributes: { ht ...

How can Play framework be used to display static HTML pages with static JavaScript and CSS files?

I'm currently exploring options for rendering or routing to static web apps stored in the Play's public folder. Here is my project structure: myapp + app + conf + modules + public | + webapp1 | + css | + ...

What kinds of font file formats are you utilizing?

In numerous projects, I have observed a common practice of using multiple font extensions such as .TTF, .WOFF, and .WOFF2. However, this can result in having multiple files for a single source. Imagine the clutter if one has several sources with different ...

Setting breakpoints on rows in Bootstrap 5: A guide

Looking for ways to modify the diagram in the image using Bootstrap 5 specifically for mobile devices ...

Having difficulties creating an array due to identical id tags causing HTML to break in JavaScript

I've been grappling with this issue all day. Before delving into dynamic solutions, I'd like to create multiple divs with unique id tags or classnames rather than repeating ids. Whichever option proves simpler would be greatly appreciated. Curren ...

Utilize express middleware for applying CSS styles in web development

How's it going? I've been experimenting with middleware in Express JS, like this: app.get ('/user/:school/:dual', function (req, res, next) {   ......   ...   ...... }); Everything seems to be working fine so far. But when I na ...

Tips on solving the Navigation bar burger problem with HTML and CSS

## I am having trouble making my navigation bar responsive using HTML and CSS as the navigation burger does not appear in mobile view ## To take a look at my code on jsfiddle, click here: [jsfiddle] (https://jsfiddle.net/abhishekpakhare/nxcdso7k/1/ ...

Maintaining the position of the screen as you type in information that is located outside of the container

I am encountering an issue with the input/text-area element in absolute position extending halfway outside the container. The screen position seems to follow the caret as I type, but I'd prefer to keep writing and have part of the text hidden beyond t ...

Can HTML text areas be designed to adjust their width automatically, as well as their height?

Among the numerous StackOverflow examples showcasing an auto-height Textarea, one noteworthy example can be found here: <textarea oninput="auto_grow(this)"></textarea> textarea { resize: none; overflow: hidden; min-heig ...