Why doesnt work <div class="col-sm-6">?

Why doesnt work <div class="col-sm-6">?
0

#1

the answer should be next to the photo not below it.


#2

You should wrap the attribute values in double quotes, like <div class="container-fluid">. Then click the little arrow in the HTML editor and hit “Tidy HTML”. Somehow, it seems to solve your problem, but I don’t understand why.


#3

<div class = container-fluid> needs to be <div class="container fluid">
Your class needed to be in double quotes, its very important.

  1. theirs no container element
  2. You have container fluid twice
  3. you could use text-align: center for centering all of that
  4. Do you have bootstrap 4 added on to your codepen? Its not automatic.
<div class="container">
    <div class="container-fluid">
        <div class="row">
           <div class="col-md-6">
// item goes here
            </div>
         </div>
     </div>
</div>

I could be wrong, but that is how i did it.


#4

It’s because of two non-breaking space characters at line 29 (right before the div). They are making it wrap on a new line:

That’s why the “Tidy HTML” solves it.


#5

Wait, how did it even get there? Somehow OP’s code inserted &nbsp;s in the page?


#6

Mmh… They are mostly equivalent to a “tab” so maybe the OP was working somewhere else and the copy-pasting somehow got the two non-breaking spaces over with it? Never happened to me before, but could be a possibility.

Edit: There are others &nbsp; right before the <form> after the <figcaption> (line 12-13):


#7

Thanks for help me :slight_smile: