Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I align text in the same line?

I hope this question doesn’t get downvoted and I get banned, this website is brutal for new users like me!
I’m trying to get this text to be in the same line but I’m not getting the hang off it

#logo {
  margin      : 0;
  padding     : 0;
  font-family : 'Dosis', sans-serif;
  font-weight : 300;
  text-align  : center;
  width       : 50%;
}
<h1 id="logo">This text
  <p>should be inline</p>
</h1>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

sorry to hear about the brutal part :/

About that, use a span instead of a paragraph.

By default, paragraphs have display: block, so they will be in a new line, you can modify that part but a paragraph inside a title doesn’t make sense

We use span for this kind of scenario, not sure why you need to wrap the should be inline inside a new element but span is the element you need for most font styling use cases

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading