[SOLVED] How would I line up this code correctly?

How would I fix this code so it’s lined up correctly?

It’s the text box underneath that is out of place.

Both codes use this same css for the text box, but why isn’t it working here, and how do I fix that?

Bad
https://jsfiddle.net/0mg2u7ck/2/

This is what the code looks like when I remove display: table
https://jsfiddle.net/fgd1xmze/1/

But display: table; seems to be working fine with the other code.

p.my-content {
  display: table;
  margin: 20px 0 0;
  background: #000000;
  width: 300px;
  border: 1px solid #0059dd;
  font-weight: 900;
  font-size: 22px;
  font-family: "Times New Roman", Times, serif;
  padding: 5px;
  color: #0059dd;
  text-align: center;
}

span {
  display: table-cell;
  vertical-align: middle;
}

<p class="my-content"><span>Some randm text<br/> Some randm text<br/> Some randm text</span></p>

Good
https://jsfiddle.net/c2190pfa/

This one is lined up correctly:
https://jsfiddle.net/knvq728w/

And how would I fix it?

<form>
  <div class="container">
    <div class="container-left">
      <input id="input" type="text" name="someNameHere" value="http://hi5.1980s.fm/;"/>
    </div>
    <div class="container-right">
      <input id="sent" type="submit" value="Set"/>
    </div>
    <div class="container-right-right">
      <input id="clear" type="button" value="Clear"/>
    </div>
  </div>
</form>
<p class="my-content"><span>Some randm text<br/> Some randm text<br/> Some randm text</span></p>

This code is uneven:
Comparing both codes why is this one uneven?

https://jsfiddle.net/tbdc9w46/


<div class="outer">
  <div class="tcell">
    <audio autoplay id="player"></audio>


    <div class="container">
      <div class="container-left">
        <button id="button">Play / Pause</button>
      </div>
      <div class="container-right">
        <div class="radios"><a href="" target="_blank">Radio Inputs</a></div>
      </div>

      <div class="container-right-right">
        <input id="input" type="text" name="someNameHere" value="http://hi5.1980s.fm/;" />
        <input id="sent" type="submit" value="Set" />
        <input id="clear" type="button" value="Clear" />
      </div>
    </div>

    <p class="my-content"><span>Some randm text<br/> Some randm text<br/> Some randm text</span></p>

  </div>
</div>

It’s hard to give an answer without knowing what you are trying to achieve.

One code has extra elements in it, the radio inputs.

Is it supposed to look like the first image

I managed to figure it out. I had div tags in the wrong spot.
https://jsfiddle.net/h3mj1wcL/7/

<div class="outer">
  <div class="tcell">
    <audio autoplay id="player"></audio>


    <div class="container-first">
      <div class="container-left">
        <button id="button">Play / Pause</button>
      </div>

      <div class="container-right">
        <div class="radios">Radio Inputs</div>
      </div>
    </div>

    <div class="container-second">
      <input id="input" type="text" name="someNameHere" value="http://hi5.1980s.fm/;" />
      <input id="sent" type="submit" value="Set" />
      <input id="clear" type="button" value="Clear" />
    </div>

    <p class="my-content"><span>Some randm text<br/> Some randm text<br/> Some randm text</span></p>

1 Like