I have the following jsfiddle:
.links {
display: inline-flex;
flex-wrap: wrap;
justify-content: space-between;
font-style: normal;
}
<html>
<body>
<address class="links">
<p>
Jeremy is on:
</p>
<a href="https://www.linkedin.com/">
LinkedIn
</a>
<a href="https://stackoverflow.com/users/5889131/jeremysprofile">
Stack Overflow
</a>
</address>
</body>
</html>
The output looks like:
LinkedIn Stack Overflow
Jeremy is on:
I don't understand why. I expect all the elements to be on the same line (or have the later elements wrap underneath, not the first element).
I noted that this happens with a <p>
or a <h1>
tag, but not a <div>
tag on the "Jeremy is on" line. I looked at the default CSS settings for <p>
and <div>
, but I didn't see anything obvious. I tried making some CSS changes with .p { margin: none; display: inline-flex;}
but it didn't make a difference.
Why does a <p>
tag get put underneath the links, and a <div>
tag not? What CSS rules can I apply to make a <p>
tag behave like a <div>
tag in this section?