Some html elements are containers, others aren't. <b> can only contain text, so there is a bunch of ignored <b>'s and </b>'s. Then comes the <em> which is followed by an unexpected closing </b>. Use div's or span's if you want to put something inside and have nesting work normally.