Positioning a div to the right of another div within a container (box)

I'm currently trying to line up two divs alongside each other within a box. Using angularJS, I am dynamically generating input boxes and looking to include an image for the delete option next to each input box. Despite using "display: inline-block", I'm running into alignment issues.

Below is the code I have so far:

<div class="contentBox box effectmission" ng-repeat="mission in missions">
        <div class="boxheader">
          <span style="font-size: large; font-family: monospace; font-weight: bold;">EDIT MISSION NAME</span><input id="{{mission.id}}" type="text" ng-model="mission.missionInfo" class="form-control" style="background-color: #e8e8e8">
        </div>
       <div style="padding-top: 10px;">
       <span style="font-size: large; font-family: monospace; font-weight: bold; margin-left:5%;">EDIT MISSION POINTS</span><br />
        </div>
        <div style="padding-top: 10px;">
            <ol style="float: left; width: 100%;">
                <li id="missioncontent.id" ng-repeat="missioncontent in mission.missionContent" style="padding: 2px; width: 100%;">
                    <div>
                        <input id="{{missioncontent.id}}" type="text" ng-model="missioncontent.info" class="form-control" style="background-color: #e8e8e8; width: 80%;">
                    </div>
                    <div style="float: right; width: 20%; display: inline-block;">
                        <span>v</span>
                    </div>
                </li>
            </ol>
        </div>
    </div>

What I have achieved thus far looks like this:

I aim to properly align the input boxes and images next to each other (where 'v' will be substituted with an image).

Answer №1

Make sure to position the v div before the <input> div in your HTML code. You may also need to apply a clear on it. It's worth noting that you can remove the display:inline-block property, as all floated elements are automatically given a display:block style.

        <ol style="float: left; width: 100%;">
            <li id="missioncontent.id" ng-repeat="missioncontent in mission.missionContent" style="padding: 2px; width: 100%;">
                <div style="float:right; clear:right; width:20%;">
                    <span>v</span>
                </div>
                <div>
                    <input id="{{missioncontent.id}}" type="text" ng-model="missioncontent.info" class="form-control" style="background-color: #e8e8e8; width: 80%;">
                </div>
            </li>
        </ol>

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

Even when it appears to be chaotic, the TypeScript array of numbers always manages to find its way back to being sorted

I recently developed a function that aims to verify if an array of numbers is sorted: const checkIfSorted = (numbers: number[]) => { return numbers === numbers.sort((a, b) => a - b); }; checkIfSorted([4, 2, 8, 7, 3, 10, 1, 5, 9, 6]); // This cur ...

Guide to utilizing variables with Pattern.compile in Java for selenium RC

I am facing a challenge where I need to check if the date in a field corresponds to the current day. In Selenium IDE, this is easily achieved: <tr> <td>storeExpression</td> <td>javascript{var date = new Date ...

The attempt to perform a Diffie-Hellman key exchange between Python and Node has hit a roadblock, as an error stating that

Currently, I am attempting to establish a DH key exchange between a Python 3.6 client and a Node server deployed in a Docker container with the latest node image (Node version: v13.10.1). On the client side, I am utilizing the cryptography.io library (v2. ...

The post data is being altered by jQuery AJAX when posting

When I'm utilizing jQuery post to send checkbox values to another file, the page works fine without any issues. However, when using jQuery post, it seems to interfere with the array and causes it to malfunction. The form fields for my radio field are ...

Is it possible to conceal and completely empty the TextBox once the checkbox is deselected?

When the checkbox is checked, the textbox is displayed; otherwise, it remains hidden. However, the value is not being cleared. Can someone please help me with this issue? Thank you in advance. HTML <div class="munna"> <in ...

Error: Reference 'ref' is undefined in the 'no-undef' context. I am interested in experimenting with loading images from Firebase storage

While working with React, I encountered an issue when trying to fetch an image URL from Firebase Storage and display the image. The error 'ref' is not defined (no-undef) occurred. https://firebase.google.com/docs/storage/web/create-reference Th ...

Assistance with JSONP (Without the use of jQuery)

I've been putting in a lot of effort trying to understand how to make a JSONP request, but all the reference materials I find are full of jQuery examples. I can go through the jQuery source code, but I prefer a straightforward and simple example. I&ap ...

Create a request for an update by utilizing Axios within a React and Material UI environment

I am completely new to React, and my experience with CRUD functionality is limited to ASP.NET MVC. I'm feeling a bit lost as none of the tutorials I've come across seem to cater to my specific situation. The tips I received previously were helpfu ...

The combination of Angular and Google Tag Manager (GTM) for tracking user clicks is highly effective

I've encountered a puzzling issue that I can't seem to resolve. The marketing department has expressed interest in integrating GTM in order to have full control over third-party providers, particularly focusing on tracking all clicks on a page. ...

I find it frustrating that Angular consistently redirects me to the login page every time I attempt to navigate to a different page

I currently have a website with both normal user-accessible pages and an admin dashboard accessible only by admins through ngx-admin. To restrict users from accessing the admin dashboard, I've implemented an auth guard that redirects them to the logi ...

`The value of an element within an array changes automatically`

In my current setup, I have a traditional array where each element represents an HTML element. The issue arises when I manipulate these elements within the array; any changes made to the HTML element also reflect in the array automatically. However, I pref ...

Tips for testing views in ember.js using unit tests

We are currently delving into the world of Ember.js. Our development process is completely test-driven, and we aim to apply the same methodology to Ember.js. Having prior experience in test-driven development with Backbone.js apps using Jasmine or Mocha/Ch ...

Is there a way to display icons alongside each option in the dropdown menu?

I have a dropdown icon (pumpkin 1) div that is causing spacing issues with the other icons on the page. The problem is that it has a dropdown functionality which needs to overlay the text at the bottom. I want to display all icons next to each other (1,2, ...

Exploring deeply nested arrays of objects until a specific condition is satisfied

My array is structured in a nested format as shown below. const tree = { "id": 1, "name": "mainOrgName", "children": [ { "id": 10, "name": "East Region", "children": [ ...

What is causing the 'Invalid Hook Call' error to appear in React?

I have recently started learning React and I am currently working on converting a functional component into a class component. However, I encountered an error message that says: Error: Invalid hook call. Hooks can only be called inside of the body of a fu ...

iOS Safari: Full-width header with fixed position exceeding viewport width

Encountered an issue specific to Safari on iOS. Creating a page with a fixed position header that spans the width of the viewport. The content consists of multiple images that should scroll horizontally while the header remains in place during scrolling. ...

What is the best way to turn off jQuery UI (widget) for a particular element?

Is it possible to disable the Jquery-UI selectmenu widget for a specific element in my project so that it reverts back to its native look and functionality? I have tried various solutions suggested in a Stack Overflow thread about disabling theming for a ...

display child element at full width within a parent element that is not full width

I have a container with a maximum width of 1024px, and I want one of its child elements to take up 100% width starting from the left edge of the screen. Is there a way to achieve this without adding extra HTML markup? I know I can make the child element 1 ...

Start a fresh project using the Teamweek API with jQuery integration

After successfully acquiring the planning details from Teamweek using the API (Get projects from Teamweek in jQuery), I am now looking to feed Teamweek a project. Even though the code below seems to work (based on the response received), I am unable to lo ...

The functionality of a basic each/while loop in jQuery using CoffeeScript is not producing the desired results

I've been experimenting with different methods to tackle this issue. Essentially, I need to update the content of multiple dropdowns in the same way. I wanted to use an each or a while loop to keep the code DRY, but my experience in coffeeScript is li ...