Inline-block, what the fuck
https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-431245.jpg?dateline=1473556056
#1
I'm trying to get two inline-blocks to sit next to eachother but for fucks sake it's not working. I'm not completely braindead but I have no idea why this isn't working. Code is shit, made a new setup just to troubleshoot this so don't judge it. Please help me.

HTML:
Code:
<div class="box">
  <div class="child">first</div>
  <div class="child">what the fuck</div>
</div>


CSS:
Code:
.box {
display:block;
width:100%;
}
.child {
display:inline-block;
width:50%;
background:red;
}

What it looks like:
[Image: 78908c8109874346866da72189d78332.png]
Reply
https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-431245.jpg?dateline=1473556056
#2
Also float is not an option.
Reply
https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-74599.jpg?dateline=1519854641
#3
Why isn't float an option? Just set [icode]overflow:hidden[/icode] on the parent
Reply
https://i.imgur.com/3kqBoC7.jpg?dateline=1542091882
#4
When the children are on new lines it creates a space between them which is what causes this. Add a comment between the children like this:

Code:
<div class="parent">
   <div class="child">
       ecks
   </div><!--
   --><div class="child">
       dee
   </div>
</div>
Doesn't require float.
Drop top BM's, I'm the man girlfriend
Reply




Users browsing this thread: 1 Guest(s)