Arrange the input fields in a vertical manner

I am trying to vertically align input elements inside h3 tags within a li list. I want them to be in the same 'column' regardless of the text size in the h3. Check out a real example here. I have attempted adjusting widths using width: calc(..), but couldn't get it to work correctly.

<ul class="prof-list col-md-4">             
       <li data-id=" 1">
          <h3 class="prof-name">Alan Naidon
             <input type="checkbox" name="" class="check_prof" value="">
          </h3>

          <ul class="list-disc ui-sortable" style="display: none;">
             <li data-id="3" class="ui-sortable-handle">Ingles</li>
          </ul>
       </li>

       <li data-id=" 2">
          <h3 class="prof-name">Antonio Nunnes
             <input type="checkbox" name="" class="check_prof" value="">        
          </h3>
          <ul class="list-disc ui-sortable" style="display: none;">
            <li data-id="5" class="ui-sortable-handle">Lab II</li>
          </ul>
       </li>                
       <li data-id=" 3">
          <h3 class="prof-name">Carlos Cardoso
             <input type="checkbox" name="" class="check_prof" value="">        
          </h3>
          <ul class="list-disc ui-sortable">
             <li data-id="6" class="ui-sortable-handle">Lab I</li>
          </ul>
       </li>

Answer №1

To ensure uniformity, consider setting a consistent width for all h3 tags and giving the inputs an identical margin-right value.

Answer №2

To create a neater layout, consider relocating the input elements from within the h3 tag and apply a float:right style to them. Additionally, make sure all li tags have uniform widths for consistency.

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

Combining 2 divs harmoniously

I have a set of HTML div elements that are styled using the following CSS: div{ width:250px; height:250px; display:inline-block; border-radius: 10px; margin:10px; background:#2E2922; vertical-align:top; } In my HTML, these div ...

What's preventing my link from opening?

I've written this code for two tabs: <li> <a href="#gallery_place" role="tab" data-toggle="tab"> <i class="fa fa-picture-o"></i> <?php _e("Gallery", ET_DOMAIN); ?> </a> </li> <li> <a href ...

The session name has not been properly defined

Sorry for any errors in translation. I'm facing an issue where the session name I insert is coming up as undefined. However, when I manually enter the username, everything works fine. View Image <? php session_start (); echo var_dump ($ _SESSION ...

Inserting jQuery into a Div container

I am attempting to execute a jQuery function within a dynamically generated div (subpage) through JavaScript. I'm relatively new to this, so please bear with me. Within the index.html file, I am filling a div using a JavaScript load command. <ul& ...

Updating the .css file through the graphical user interface, within the managed bean

I have created a jsf page with colorpickers to allow an administrator to modify the main theme of the site, which consists of 4 colors. I have prefixed my main colors in the css file with numbers like this: .element{ background: /*1*/#333333; } When ...

Ways to transform a 4-column CSS table into a 2-column layout for mobile and tablet viewing

For my latest project, I am faced with the challenge of creating a responsive table that transforms from 5 columns to 2 columns on smaller screens. While using complex jQuery is an option, I prefer a more semantic approach. Additionally, I need to incorpor ...

Extracting the inner content in the absence of an HTML element, only plain text

My website's platform has some unusual HTML that I need to work with. There is a section of code that looks like this: <div class="report-description-text"> <h5>Description</h5> Welcome to Ushahidi. Please replace this report with a ...

Leverage React.js by incorporating a Header-Imported JavaScript Library

I recently developed a React.js web application and am exploring the use of Amplitude Analytics, which provides a Javascript SDK found here. According to the guidelines, I need to include a <script></script> within the <head></head> ...

Instructions on how to add an ExternalLink to a webpage linking back to the previous page

I'm in the process of creating an error page for my app, and I'm trying to figure out how to add a Wicket ExternalLink that takes users back to the previous page. I believe I need to store the parameters or entire URL of the last visited page, b ...

When the font size is set below 16px on an iPhone, iOS will automatically zoom in to compensate

Currently, I am running tests on my app using an iPhone. Everything seems to be working correctly on the iPad, but when I try clicking on a text field on the iPhone, the view automatically zooms in. It appears that setting the font size to 16px or larger r ...

Concealed Text Entry

Hi, I am looking to create a simple input text field that functions like this example. <input type="text" id="pin" name="pin" maxlength="4" size="4" placeholder="____"> I would like the placeholder on the front end to stay visible until all charact ...

Strategies for aligning Bootstrap tooltip text vertically in the center

Is there a way to perfectly center the text vertically inside a Bootstrap tooltip? I've tried adding this CSS but it still leaves about 1px or 2px of space at the bottom: .tooltip-inner { text-align: center !important; justify-content: center !im ...

Opt for JavaScript DOM manipulation over jQuery for element selection without depending on jQuery

I am attempting to target a specific element using JavaScript: element = '<div class="c-element js-element">Something Here</div>'; When I try to select this element with the following code: $(element) The result is not as expected ...

How can I make a dropdown menu appear when I select a checkbox?

Is it possible to have a dropdown menu with changing options appear when I click on a checkbox using HTML and JavaScript? I have experimented with some code snippets in JavaScript as a beginner, but I am unsure if they are needed here. Is there an altern ...

What could be the reason behind a CSS caption overlapping another image within this table?

This is the CSS caption effect I am using: .cell { position: relative; width: 180px; height: 180px; } .caption {} .cell .caption { opacity: 0; text-decoration-color: gray; text-align: center; background: #eaeaea; position: absolute; fo ...

Utilizing the ternary operator in Angular HTML templates

Using the ternary operator in HTML can simplify your code: <div> {{ showStringOneFlag ? 'Display String 1' : 'Display String 2' }} </div> This approach could save you from setting a string variable multiple times in JavaSc ...

"Exploring the insertion of a line break within the modal body of an Angular application

Is it possible to create a modal for error messages with multilined body messages without altering the modal template? Any assistance would be greatly appreciated. <div class="modal-body" > <p *ngIf="!_isTranslatable">{{_modalBody}}</p&g ...

Error in React: Mixing units is not allowed when using vw and px together in the css calc() function

Is there a way to create fluid font size using the css calc() function in React without running into errors when mixing vw and px units? font-size: calc(14px + (26px - 14px)) * ((100vw - 300px) / (1600 - 300)); I encountered an error where SASS was unabl ...

Detecting media queries for the Samsung Galaxy S3 and S4 devices

I have been working on implementing media queries to show text boxes with different styles for iPhone 5, iPhone 6, Samsung Galaxy SIII, and Samsung Galaxy S4. Initially, everything was working fine for iPhone 5 and iPhone 6, but when I switched from an i ...

Col-*-Bootstrap does not function in the presence of col-*-*, even though it is expected to be the primary choice

UPDATE: The latest version of Bootstrap seems to be working fine for me. I'm currently developing a website using Bootstrap 4. I've noticed that col-xs-* has been deprecated in 4.0 and the default from 0px up is now col-*. I have specified "col ...