DEV Community

Darcey Mckelvey
Darcey Mckelvey

Posted on

How do I write this HTML line better

Just getting back into programming, know the basic's and a bit more but I tend to write bad code(I think anyways).

https://codepen.io/anon/pen/yjVqXQ

My question is, do I have to use span tags in this to make it work? I am trying to set it up so in css I'll be making ex nihilo sit on-top of SOFTWARE. It just looks weird to me. Would making two h1's and put it into a flex box better?

Top comments (4)

Collapse
 
midblue profile image
Jasper Stephenson • Edited

If you want them to be simply on top of one another, just make them both <div>s instead of <span>s. By default, spans have the property "display: inline" which makes them fall side by side. Divs, on the other hand (since they default to "display: block") will fill the entire width of their container.

Collapse
 
andy profile image
Andy Zhao (he/him)

Hmm, sit on top as in this:

Ex nihilio
Software

Or would ex nihilio overlay software?

For whatever reason I don't see any CSS, maybe cause I'm on a mobile view.

Collapse
 
darceymckelvey profile image
Darcey Mckelvey

yeah sit on top

Collapse
 
nektro profile image
Meghan (she/her) • Edited

You can set the a to use flex box