Jone
Jone

Reputation: 11

How can I show in the same line logo and title in HTML without CSS?

I would like to show in the section a logo, title, and navigation menus without using CSS, only HTML 5 if that is possible but I can't make it work.

<body>
    <header>
        <img src="logo.png" width="128" height="128">
        <h1 >text</h1>
    </header>
</body>

Upvotes: 1

Views: 1271

Answers (3)

phentnil
phentnil

Reputation: 2279

Just using HTML5, you could place the img tag in the h1 tag. See the result below. It could be further enhanced with CSS, but it's up to you if/when you want to do that.

<header>
  <h1>
    <img src="logo.png" width="128" height="128">
    text
  </h1>
</header>

Upvotes: 1

James Son
James Son

Reputation: 1

It's safe and cool to use css. However, you can span the image and text on the same line simply by making use of span tags instead of h1 tag.

Upvotes: -1

Shaded
Shaded

Reputation: 158

You could use a table? But I don't see why you wouldn't want to use CSS?

<table>
  <tr>
    <td><img src="https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/dog-puppy-on-garden-royalty-free-image-1586966191.jpg?crop=1.00xw:0.669xh;0,0.190xh&resize=640:*" alt="logo thats really just a dog" width="128px" height=-"auto" /></td>
    <td><p>some text<p></td>
  </tr>
</table>

Upvotes: 1

Related Questions