Dan Jones @[email protected]

Husband, Father, Software Engineer (PHP, go, etc.). Lover of Star Trek and anime.

Looking for other things to do, such as writing, acting, voice acting, but not really finding the time for it. Maybe when my kids are a little older, I'll get back on stage.

Feeling pretty bleak about the future of the United States. #NeverTrump

Feel free to follow. I may follow back if we seem to have similar interests.

#BlackLivesMatter #TransRightsAreHumanRights #StayWoke

Other interests: #Parenting #StarTrek #Writing #Theater #anime #PHP #golang #Programming #WebDevelopment #genealogy #ScienceFiction #DadJokes

My Links

links.danielrayjones.com

Pronouns

he/him/his

XMPP

[email protected]

Mastodon account

fosstodon.org/@danjones000

LinkedIn

linkedin.com/in/danjones000

Résumé

danielrayjones.com

  • Notes
  • Articles
  • Followers 224
  • Following 304
  • Remote follow
Dan Jones's avatar
Dan Jones
@[email protected]

Hey #WebDevs. Got an #HTML question.

When combining the code and pre tags, which one should go inside which?

Should it be <code><pre> ... </pre></code>, or <pre><code> ... </code></pre>.

I need to do both because the code in question might have line breaks, so pre will ensure that those are rendered correctly.

It seems to work either way. pre on the outside adds some extra margin, I think. I didn't look at it too closely.

But, I'm not sure which is the more correct way.

#AskFedi #AskWebDev

  • permalink
  • interact from your instance
  • 2 years ago
  • 1 reply
Dan Jones's avatar
Dan Jones
@[email protected]

in reply to this object

I found my answer, according to MDN.

The <pre> tag allows as children any "phrasing content". <code> is included in that. So, <pre><code> ... </code></pre> is valid.

However, <code> also allows "phrasing content" as children. And <pre> is not included in that. So <code><pre> ... </pre></code> is invalid.

  • permalink
  • 2 years ago
Powered by microblog.pub 2.0.0+9c8693ea and the ActivityPub protocol. Admin.