Analyzing a Random Quote Generator_Question about what seems to be a missing closing div


I am noticing that line 43 in the HTML code of the following random quote generator contains an opening div without its closing div. The code runs as intended. In what situations can we use stand-alone opening divs? Thank you for the help.

The code in question is <div class="ripples buttonRipples"> in

              <div class="randomBtn">
                <button class="btn btn-primary btn-lg buttonBlue" ng-click="randomQuote($event)">Random<div class="ripples buttonRipples"><span class="ripplesCircle"></span></button>
              </div><!-- End of Random Button -->


I forked the pen and CodePen is now saying that I am the author. This was not intended.


There aren’t any cases where it’s okay to omit the closing tag for an element unless it is a void element where closing tags are not expected. A <div> always requires a closing </div>.

When the HTML is invalid, as in this case with a missing </div>, it’s up to the browser to guess what needs to be done. We are encouraged to write valid HTML all the time so our code appears consistently across all browsers.

You can find more information over at

And not to worry about making yourself look like the author - in the details view of your pen, it shows the original author: