monie
monie

Reputation: 63

How do I make a text align under a logo using css?

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>

Upvotes: 0

Views: 68

Answers (2)

NeNaD
NeNaD

Reputation: 20334

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>

Upvotes: 2

eluCom
eluCom

Reputation: 1

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?

Upvotes: 0

Related Questions