Unable to get div elements to expand to their full width

Trying to center items within a div, but having issues achieving the desired output.

This is an image of the desired layout: https://i.sstatic.net/949al.png

The items in the div are aligning to the left and the input text does not stretch across the full width of the div. I also want to create space between the text and the gear icon on the orange buttons.

Below is the code snippet:

<af:dialog contentWidth="400" type="none" id="aaa" modal="true">
        <div class="row">
            <div class="col-md-8 sm-b-b">
                <div class="sm-padding-5">
                    <af:inputText inlineStyle="display: inline-block;width:100%" value="sohoooooooooooooooooo"
                                  simple="true" id="it1"/>
                </div>
            </div>
            <div class="col-md-4 sm-b-b">
                <div class="sm-padding-5">
                    <af:button inlineStyle="display: inline-block;width:100%" text="Search" id="b1"></af:button>
                </div>
            </div>
        </div>
        <af:forEach var="node" items="#{bindings.ViewObj11.collectionModel}">
            <div class="row">
                <div class="col-md-12 sm-b-b">
                    <div class="sm-padding-5">
                        <af:link text="#{bindings.Value1.inputValue}" styleClass="btn btn-primary white" id="ot1">
                            <span aria-hidden="true" class="fa fa-gear"></span>
                        </af:link>
                    </div>
                </div>
            </div>
        </af:forEach>
    

Answer №1

Experiment with this Design in your CSS file

 .centered-box{
   margin: 0 auto;
   text-align: center;
   width: 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

How can I dynamically resize an element based on the height of its content in Ionic?

Is there a way to make my element expand conditionally? I would like it to expand on click based on the height of its content. This is what the component's HTML looks like: <div class="container" [style.height]="enlarged === true ? ...

The entire background image is too large to fully display on the screen

(Source: https://i.sstatic.net/nZFuU.jpg.) Hi there, I have two files - one called "header" and the other called "footer". They are both the same size but mirror images of each other. The issue I'm facing is that the width of these files doesn' ...

Incorporating a class into ever-changing Bootstrap Table rows

Looking to enhance my table rows with a class, excluding the header. Struggling to find a way to do this. Any ideas? This is the table in question: <table id="table" class="hidden table table-bordered table-striped table-hover"> <thead> ...

The Nivo slider's position is being adjusted

I've been trying to adjust the width of the Nivo slider on my blog. Right now, it's taking up the entire width of the page wrapper and I want to add some space on the left and right sides so that it's centered and lines up with the navigatio ...

`Make Bootstrap 5 Modal centered horizontally`

I'm facing an issue with my Vue application where the Bootstrap 5 modal is not horizontally centered on desktop. Below is the code snippet of my component: Modal.vue <template> <teleport to="#modal-container"> <div ...

With Vue's new implementation of adding data attributes to the "*" selector, how can I adapt to this change?

Typically, I reset all margins/paddings by including the following code snippet at the beginning of my CSS: *, body { margin: 0; padding: 0; } This method usually works fine since it is overridden by subsequent selectors. However, Vue appends data att ...

Using Javascript to automatically submit a form when the enter key is pressed

Can anyone help me with a password form issue? I want the enter key to trigger the submit button but it's not working for me. I understand that the password can be viewed in the source code, this is just for practice purposes. <!DOCTYPE html> & ...

Controlling CSS Styles in Angular using TypeScript

Currently, I am working on an Angular project that involves dynamically populating a calendar. In addition to this, I have a range of dates and the task at hand is to modify the background for specific days within this date range. To manage dates effective ...

What is the best way to position the top line next to the border?

I've been attempting to create a falling line effect on the left side of the box's border, but I can't seem to figure out what's causing the issue. Below is the code snippet: @import url('https://fonts.googleapis.com/css ...

What steps can I take to ensure that Bootstrap components are compatible with my mobile device?

[![This is the result I see when accessing my page on a mobile device <head> <title>Login Page</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=devic ...

I just obtained the height measurement of a dynamic table - now I must transfer this height value to a different element

Recently, I encountered a situation where I needed to get the height of a dynamic table using code like this: var table = document.getElementById("test"); document.write(table.offsetHeight); However, the challenge arose when I realized that I also needed ...

Enable scrolling of the background with ngb Modal

I need help figuring out how to remove the overflow: hidden style applied on <body class"modal-open"></body> This is related to using bootstrap 4 modals. I want the background to be scrollable. Thanks! Edit: I tried using renderer2 for An ...

Exploring the differences between translate3d and matrix in CSS 3 animations

Lately, my projects have demanded seamless transitions and animations. We've made the shift from using Javascript to CSS animations almost entirely. I've discovered that utilizing translate3d produces incredibly smooth animations on various devi ...

Enhancing audio control features using HTML and JavaScript

After utilizing various suggestions, I have successfully created a basic audio slider that starts playing sound (at zero volume) when clicked by the user. They can then adjust the volume as needed. My only challenge is that the volume adjustment only occu ...

On the same line, there are two divs with different characteristics - one dynamically changing width and the

I am facing an issue with arranging two divs under one parent div. The parent div is set to have a width of 100%: <div id="parent"> <div class="left"></div> <div class="right"></div> </div> The specific conditions ...

Bootstrap 4 Collapse - Ensuring that collapsed elements remain open when expanding other accordions

Can someone help me figure out how to keep an element open when another one is opened? Here is an example: https://getbootstrap.com/docs/4.0/components/collapse/ <div id="exampleAccordion" data-children=".item"> <div class="item"> & ...

Align button text vertically in the middle using Flexbox with Bootstrap 4

Why is the text in the button displaying at the top instead of the center when using internet explorer? button { height: 100px; } <div class="container"> <button class="w-100 f-default-f btn btn-primary d-flex justify-content-between px-3"& ...

Is there a way to include captions within a bootstrap carousel-item without compromising the responsiveness and alignment of the indicators and controls?

<div id="myUniqueCarousel" className="carousel slide" data-bs-ride="true"> <div className="unique-carousel-indicators"> <button type="button" data-bs-target="#myUniqueCarousel" data-bs-slide-to="0" className="active" aria-curre ...

Rotating an HTML caret using CSS does not pivot from the center point

Is there a way to adjust my simple caret rotation to make it rotate from the center? What changes should I make? const Wrap = styled.div` width: 100px; background: grey; span { display: block; transform: ${(props) => (props.isOpen ? " ...

A guide on dynamically accessing an image from the src directory using props in a Vite + React application

export default function Card(props) { return ( <card> <img className={cardCss.card__img} src={`../assets/imgs/card/${props.img}`} alt="" /> <div className={cardCss.card__stats}> ...