Solution 1 :

Put the text in the same div where the logo is:

<div class="logo"> 
  <img class="img" src="photos/logo1.png" alt="the logo">
  <p class="subtext"> We care about you </p>
</div>

Solution 2 :

Both and

are block elements, by default those tags go to the new line.
So what was your intention, putting the subheading right under the logo?

Problem :

I am trying to make a subheading for a logo in my website. I am having trouble with aligning it under the logo. I have placed a p tag inside a div and tried to position the div but I am not sure how it works.

Here is a photo of what the website currently looks like.
enter image description here

below is the code for it.

HTML:

<!--logo goes here-->
<div class="logo">
  <img class="img" src="photos/logo1.png" alt="the logo">
</div>

<div class="textbox">
  <p class="subtext"> We care about you </p>
</div>

Comments

Comment posted by biberman

img

Comment posted by Community

Please add further details to expand on your answer, such as working code or documentation citations.

By