Modify the alignment of buttons in a form by adding or removing them dynamically

I need some help with aligning my small form properly. It seems to be misaligned and messy, especially when I click on the plus button. The issues I'm facing are:

  1. The blue content on the right side expands vertically causing extra space. I want it to stay at a fixed height.
  2. The minus button needs to be positioned correctly next to its corresponding line.
  3. The plus button should also be aligned properly.

Any assistance would be greatly appreciated.

Here is the code snippet:

<div class="row">
    <div class="col-md-8">
        <mat-dialog-content class="mat-typography">
            ... (code continues)
        </mat-dialog-content>
    </div>
    <div class="col-md-4 callout callout-info no-margin">
        <li>Format: post:/api/v1/addAccount/id
            <br> &nbsp;&nbsp;&nbsp;&nbsp; Usage :
            <ul>
                <li>post:/api/v1/addAccount/id</li>
                <li>get:/api/v1/getAccount/id</li>
                <li>put:/api/v1/updateAccount/id</li>
                <li>delete:/api/v1/deleteAccount/id</li>
            </ul>
        </li>
    </div>

</div>
<mat-dialog-actions class="pull-right" align='end'>
    <button mat-raised-button class="nav-btn text-primary" type="submit" [disabled]="checkFormValidity()"
        (click)="saveEndPoint()">Save</button>
    <button mat-raised-button class="nav-btn text-primary" (click)="dialogRef.close()">Cancel</button>
</mat-dialog-actions> 

This is how the current design looks like:

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

Answer №1

  1. To restrict the height of the right side, consider using the CSS property height: fit-content;
  2. If you are organizing each element (minus, form) in distinct rows, switch to columns for a side-by-side layout
  3. To align the plus sign correctly, ensure it is placed within the appropriate container and provide details on what constitutes "aligned properly"

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 populate a cell in a table automatically?

Is there a way to dynamically fill a cell in the table after the user selects an option within the column? The update function inside the select is functioning, but I am unable to update the second column of the row with the selected value from the dropdo ...

Execute function upon initial user interaction (click for desktop users / tap for mobile users) with the Document Object Model (DOM)

Looking to trigger a function only on the initial interaction with the DOM. Are there any vanilla JavaScript options available? I've brainstormed this approach. Is it on track? window.addEventListener("click", function onFirstTouch() { console.l ...

Show the attribute of an element in a pop-up window

I have a modal from ngx-bootstrap that I want to display in there a property of my object let's say the name: public students = [ { id: 1, name: 'lorem'} In this button that is common for all entries in the table (each row has this butt ...

Issue with displaying options in Angular2 v2.4.9 HTML select element

Ever since I made the transition from AngularJS to Angular2, I've been facing a peculiar issue. The select element's options data is fetched from a Solr query, which always returns a 200 response with the data in a timely manner. However, the pr ...

What is the best way to create a function that automatically resumes audio playback 3 seconds after the pause button is clicked?

I am looking to develop a basic webpage with an autoplay audio feature. The page would include a "pause" and "play" button. I aim to implement a function where clicking the "pause" button would stop the audio, but after 3 seconds, it would automatically re ...

Challenges with Isotope brickwork design and Bootstrap lightbox

I am currently experimenting with using isotope's masonry version to showcase a collection of thumbnail images, paired with the bootstrap lightbox plugin to enlarge these thumbnails. The images are retrieved from my Flickr XML feed using PHP to extra ...

Updating the Animation for Datepicker Closure

While using the date picker, I want it to match the width of the input text box. When closing the date picker, I prefer a smooth and single motion. However, after selecting a from and to date, the datepicker no longer closes smoothly. I have attempted sol ...

How can I conceal the contents of a webpage until the entire page has finished loading before revealing them?

Is there a way to delay displaying my login template until all elements are fully loaded? Currently, when I visit the site, the template appears first followed by fonts and other components. I want to ensure that nothing is shown to the user until the enti ...

What's the best way to align text at the center of this DIV?

I recently created a small offline website with a header that includes a logo, navigation bar, and notification bar. While I managed to align everything as intended, I encountered an issue with the text alignment within the notification bar (header-alert). ...

Fixed header design with CSS Bootstrap

Can a table be created in bootstrap with fixed headers and scrollable content similar to the example shown here? Is it possible for columns to adjust their size based on the content they contain (wider or narrower)? Also, is it possible to have a horizon ...

Achieving a consistent fixed width for tbody even when scrollbar is present

thead{ width: calc(100% - 17px); display:block; } tbody{ display:block; overflow-y: auto; height:100px; } http://jsfiddle.net/mkgBx/ Is there a way to adjust the width of the tbody element to match that of the thead element plus the scrollbar? Currently ...

What is the best method for importing data into an array using AngularJS?

Check out the Plunker link I have shared. Can you help me identify any mistakes? <a href="https://plnkr.co/edit/3VryaPGtgPRD6Nn8zx7v">Click here to visit the Plunker page</a> ...

Tips for personalizing the css styles of an alert box?

I am in need of customizing the alert box using CSS attributes. Currently, I am able to achieve a similar effect with the code below: JQUERY: $('<div class="alertMessage">Error first</div>') .insertAfter($('#componentName' ...

The jquery click event is not working as expected

Hey there, I've been working on creating a dropdown menu that can be activated by clicking for better usability on touch screens. $('a.dropsmall2').click(function() { $(this).next('ul').slideToggle(500,'easeInOutQuad'); ...

Is it possible to showcase D3 charts on an .epub file?

For my research project, I am exploring the possibilities of .epub files and experimenting with embedding JavaScript code to display data visualizations. I am currently using calibre to convert an HTML file containing D3 scatterplots into an .epub. The s ...

Chrome experiencing issues with box-shadow on display:table-row-group

box-shadow doesn't seem to be functioning properly in Chrome for me. In my table layout, I need to use the display property set as table-row-group. I've been attempting to apply a box-shadow to the tbody element but it's not producing the d ...

A white background emerges when I select md-dropdown

Lately, I've been experiencing an issue on my website where a white background pops up whenever I click on a dropdown (md-select) in my form. Initially, it only happened with forms inside a modal, but now it's affecting dropdowns across the entir ...

Setting a menu item as active in a SvelteKit app: A step-by-step guide

I encountered an issue with the main navigation menu in my sveltekit application. The problem is that when the app is loaded or refreshed, the active menu item corresponding to the current URL is not set. After struggling to find a solution online, I manag ...

The behavior of the jQuery slick slider is acting oddly

Currently, I have implemented the Slick Slider for my product loop in order to display the products in a slider format. However, upon the initial page load, there appears to be a significant white gap below the products. Interestingly, when I interact with ...

Can SCSS extend Bootstrap classes without the need to import the entire Bootstrap library?

In my custom project, I've defined a unique class in the sample.scss file. .custom-class { @extend .rounded-pill; @extend .border; @extend .bg-light; } During compilation, an error is generated stating: The target selector was not found ...