Based on this answer, I wanted to implement sidenotes on a blog using a CSS flex box. I ended up with this HTML code:
article {
width: 66%;
}
aside {
width: 33%;
}
.lfloat {
flex: 1;
float: left;
}
.rfloat {
flex: 1;
float: right;
}
.pwn {
display: flex;
}
<section>
<h3>Lorem ipsum dolor</h3>
<p>
Lorem ipsum dolor sit amet...
</p>
<p class="pwn">
<article class="lfloat">
Lorem ipsum dolor sit amet...
</article>
<aside class="rfloat">
This is just a small comment
</aside>
</p>
<p>
Lorem ipsum dolor sit amet...
</p>
</section>
Instead of getting a sidenote with the same height, safari begins the next paragraph directly under the sidenote, adjacent to the other paragraph. Vivaldi does even quirkier by moving the "L" before sidenote and resuming the next line with "orem ipsum...". (Links are pictures of the rendered output by both browsers)
Questions:
- Is my code bad or is the feature implementation of the browsers causing me this issue?
- How could I fix the issue, so that it renders robustly at least on FF, Safari and anything built on top of chromium?
` tag should be used to represent a single paragraph of text. It should not contain `
– Turnip Sep 08 '17 at 12:15` or would it break as well?
a bit more, because it just simplifies it for myself to have things consistent and use semantic tags whenever I can.
– tifrel Sep 08 '17 at 12:34