How do I get my box 3 to align to the right of box 2?

css box alignment
flexbox
align-items: stretch not working
vertical-align div
justify-items
align-items vs align-content
css align columns
css align-items right

I am trying to get my "this is box 3" to align to the right of "this is box 2" all inside the parent container. Box 3 and Box 2 should overlap and be next to each other? I have tried to use "display: inline; however that does not do anything. Any advice would be appreciated?

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

.container {
  width: 300px;
  height: 600px;
  border: 5px solid black;
  padding: 20px;
  margin: 0 auto;
}

.box1 {
  height: 50%;
  width: 90%;
  border: 1px solid black;
  padding-top: 10px;
  margin: 0 auto;
  text-align: center;
}

.box2 {
  height: 50%;
  width: 50%;
  border: 1px solid blue;
  text-align: center;
  margin-top: 10px;
}

.box3 {
  height: 50%;
  width: 50%;
  text-align: center;
  border: 1px solid red;
  float: right;
}
<div class="container">
  <div class="box1"> this is box 1 </div>
  <div class="box2"> this is box 2 </div>
  <div class="box3"> this is box 3 </div>
</div>

Add float: left to .box2 and marign-top: 10px to .box3:

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

.container {
  width: 300px;
  height: 600px;
  border: 5px solid black;
  padding: 20px;
  margin: 0 auto;
}

.box1 {
  height: 50%;
  width: 90%;
  border: 1px solid black;
  padding-top: 10px;
  margin: 0 auto;
  text-align: center;
}

.box2 {
  height: 50%;
  width: 50%;
  border: 1px solid blue;
  text-align: center;
  margin-top: 10px;
  float: left;
}

.box3 {
  height: 50%;
  width: 50%;
  text-align: center;
  border: 1px solid red;
  float: right;
  margin-top: 10px;
}
<div class="container">
  <div class="box1"> this is box 1 </div>
  <div class="box2"> this is box 2 </div>
  <div class="box3"> this is box 3 </div>
</div>

CSS Box Alignment, The CSS Box Alignment module specifies CSS features that relate to are aligning it to the physical dimensions of top, right, bottom and left. The CSS Box Alignment module specifies CSS features that relate to the alignment of boxes in the various CSS box layout models: block layout, table layout, flex layout, and grid layout. The module aims to create a consistent method of alignment across all of CSS. This document details the general concepts found in the specification.


You can use display: flex with flex-wrap: wrap on the .container:

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 300px;
  height: 600px;
  border: 5px solid black;
  padding: 20px;
  margin: 0 auto;
  text-align: center;
}

.box1 {
  height: 50%;
  width: 90%;
  border: 1px solid black;
  margin-bottom: 10px;
  padding-top: 10px;
}

.box2,
.box3 {
  height: 50%;
  width: 50%;
}

.box2 {
  border: 1px solid blue;
}

.box3 {
  border: 1px solid red;
}
<div class="container">
  <div class="box1"> this is box 1 </div>
  <div class="box2"> this is box 2 </div>
  <div class="box3"> this is box 3 </div>
</div>

Box alignment for block, absolutely positioned and table layout , Absolutely positioned elements. The alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right. The  Both specifications use the alignment properties as detailed in the Box Alignment specification. You can see how these properties behave when working with a grid in the MDN article Box Alignment in Grid Layout, and I have also compared how alignment works in these specifications in my Box Alignment Cheatsheet. See Also. Box Alignment


You can use this code

        body {
            margin: 0;
            padding: 0;
        }
        html {
            box-sizing: border-box;
        }
        *,
        *:before,
        *:after {
            box-sizing: inherit;
        }
        .container {
            width: 300px;
            height: 600px;
            border: 5px solid black;
            padding: 20px;
            margin: 0 auto;
        }
        .box1 {
            height: 50%;
            width:100%;
            border: 1px solid black;
            padding-top: 10px;
            margin: 0 auto;
            text-align: center;
        }
        .box2 {
            height: 50%;
            width: 50%;
            border: 1px solid blue;
            text-align: center;
            float: left;
        }
        .box3 {
            height: 50%;
            width: 50%;
            text-align: center;
            border: 1px solid red;
            float: right;
        }
    <div class="container">
        <div class="box1"> this is box 1 </div>
        <div class="box2"> this is box 2 </div>
        <div class="box3"> this is box 3 </div>
    </div>

CSS Box Alignment Module Level 3, 2. Overview of Alignment Properties. The box alignment properties in CSS are a set of 6 properties that control  Tab Position establishes the space between the number and the next character in the first line. If you’re not using a paragraph style (Shame on you! Styles are your friends!), you’ll find the same controls in the Paragraph panel (Window > Type & Tables > Paragraph) (see below).


PowerPoint 2010 All-in-One For Dummies, Select the text box. 2. Right-click the text box and choose Format Shape. 3. Go to the Text Box category. 4. Choose an AutoFit option: Do Not Autofit, Shrink frame or text box is governed by how it is aligned with respect to the box or frame,​  Hi, I am trying to align some checkboxes to the right of the text describing the checkbox options. Since the choices are of various lengths, I have to do something extra to get the checkboxes to


Microsoft PowerPoint 2013: Comprehensive, 2. Type text into the text box. 3. Change the text box outline color. 4. Change the 2. Apply a gradient to the text box. 3. Align the text box in the center of the slide. Due to electronic rights, some third party content may be suppressed from the  3. In the popped out Tabs dialog box, do the below operations: (1.) Enter a tab number into the Tab stop position text box that means the position where you would like the right hand text to end; (2.) Check Right option in the Alignment section; (3.) Then, click Set button; (4.) At last, click OK button to close this dialog box. 4. After finishing the above settings, now, you can type the text in right hand.


Enhanced Microsoft PowerPoint 2013: Comprehensive, 2. Type text into the text box. 3. Change the text box outline color. 4. Change the 2. Apply a gradient to the text box. 3. Align the text box in the center of the slide. Due to electronic rights, some third party content may be suppressed from the  Left and Right Align - Using position One method for aligning elements is to use position: absolute; : In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.