Two blocks of content side by side

two divs side by side
two divs side by side inline-block
elements inside div side by side
two divs side by side flexbox
two spans side by side
two div elements side by side
align two divs side by side
html two sections side by side

I want to write some content on a website and put a form right next to it like in the example below.

Example

This is the code I'm using:

<div id="wrapper">
<div id="block1">
<h3>Your body is a temple.</h3>

Schedule an appointment now and start living a better life.
You deserve it.
</div>

<div id="block2">
<em>*Please include correct contact information so we can get back to you.</em>
[contact-form-7 id="28921" title="Make an appointment"]
</div>
</div>

CSS:

#wrapper {
    width:1000px;
}
#block1 {
    float: left;
    width:500px;
}
#block2 {
    float: left;
    width:500px;
}

Unfortunately it doesn't display right:

PIC

I've tried several other ways found here on stackoverflow but I just can't seem to get it working. This is the live site in case it helps: orlandochiropractic.org. You have to go to the strip that says "NEED HELP?" and click on the "MAKE AN APPOINTMENT" button.

Any help would be greatly appreciated. Thank you!

It appears your problem is on the wordpress form class, look at this element:

<div role="form" class="wpcf7" id="wpcf7-f28921-p28210-o1" lang="en-US" dir="ltr">

Look at this style, it have a margin-left set, just overide it with this:

div.wpcf7{
   margin-left: 0; //If necessary use !important
}

Then i moddified a bit your code to fit the element view, here's follow the code:

#wrapper:after{
   content: "";
   display: table;
   clear: both;
}

#block1{
   float: left;
   width: 480px; //Removed 20px beacause you have a padding on the father's div
}

#block2{
   float: left;
   width: 480px; //Same as block1
}

Hope it helps your problem.

How to float three div side by side using CSS?, How do you put two things side by side in HTML? The padding property creates padding space on all sides of an element’s content. The margin property in CSS creates a space around the element. Also, you can choose any color you want from the color picker for the text. Example of aligning divs side by side using the “flex” value of the CSS display property:

.wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.block {
  flex: 1;
  padding: 20px;
}
<div class="wrapper">
  <div class="block">
    <h3>Your body is a temple.</h3>
    <p>Schedule an appointment now and start living a better life.
  You deserve it.</p>
  </div>
  <div class="block">
    <em>*Please include correct contact information so we can get back to you.</em>
    <div>[contact-form-7 id="28921" title="Make an appointment"]</div>
  </div>
</div>

How to place two divs next to each other in HTML?, > next to each other in HTML. Use the CSS property float to achieve this. With that, add height:100px and set margin. To position the divs side by side, we are using the float property to float each .float-child element to the left. Since they are both floating to the left, they will display side by side if there’s enough space for both to fit. They do fit because we have two .float-child divs, each at 50% width.

You need to change this css

div.wpcf7 {
    margin-left: 0;
}
#wrapper {
    width: 960px;
}
#block1,#block2 {
    float: left;
    width: 480px;
}
.clearfix{
    clear:both;
}

and add

div <div class="clearfix"></div> below block2

Div side by side in one line, How do I make two divs display on the same line? The above code is trying to place the #left div and the #right div, side by side, in a single row. But as you can see in the above JSFiddle URL, this is not the case. I am able to resolve the issue reducing the width of one of the divs to 49%.

        #wrapper {
           padding: 20px;
            float: left;
            width: 100%;
        }
        .paoc-popup-modal-cnt{
           padding: 0;
        }
         #block1 {
            float: left;
            width: 50%;
        }
        #block2 {
            float: left;
            width: 50%;
       }
       div.wpcf7 {
        margin-left: 0;
       }

Use the Bootstrap Grid to Put Elements Side By Side, How do I make two divs side by side in bootstrap 4? There are two ways (and possibly more) to place content side-by-side in a beamer presentation, the columns and the minipage environments. The first is a beamer-specific environment and is therefore only available in a beamer presentation. Whereas the latter has other applications and is available in all document-classes.

How to put two divs side by side, , and the buttons themselves can be nested within it. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more Two divs side by side - Fluid display

3 ways to display two divs side by side (float, flexbox, CSS grid , <div style="display: inline"> <div style="width:80%; display: inline-block; As far as the content boxes go, I would suggest trying to use <div class="second-box"​> <p>Sign up Info</p> </div> <footer> <div>Website Info</div> </footer> </div>. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more Having 2 blocks of text side by side

Seven Quick Ways to Do a Left/Right Layout, Here are 3 ways you can use CSS to place HTML div elements side by side. blocks to have an outer div ( .float-child ) in order to add space and also have both blocks fit side by side. Flexbox will fit the content for you! Line Block and Spacer Block. The Line Block and Spacer Block are useful tools for separating content into columns and rows. Since Text Blocks often merge when stacked, you can use a Line or Spacer Block to divide text and prevent merging. See the section below on Text Blocks for help with this.

Comments
  • Code dump, doesn't help anyone, apparently the op doesn't know anything about flex box since he's using floats, so it's better if you'd explain what you've done, this is a helping/teaching forum, not a coding service.
  • You are not in the position to assume that this person does not know anything about flex box. The op might have heard from it but never used it and can now analyse the code further more to understand it. Any additional questions can always be asked here in the comments. I'll be happy to answer them. Have a good day.