1

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>
Jone
  • 11
  • 1
  • It won't work since img and h1 have display block by default. What's the point to not use CSS? To achieve this more easily you can use Flexbox – Gabriel Francisco Nov 03 '21 at 12:25
  • I thought it may be possible to avoid CSS but if it not possible then I suppose the easier way is to create the – Jone Nov 03 '21 at 12:33
  • The right way is to make a separate file for CSS. Use . – Gabriel Francisco Nov 03 '21 at 13:14

3 Answers3

1

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>
Shaded
  • 158
  • 1
  • 9
1

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>
phentnil
  • 2,195
  • 2
  • 14
  • 22
  • I like the idea, I just see that the text is not centered to the height of the image. Can it be also centered? – Jone Nov 04 '21 at 12:41
  • That can be done with CSS: [`vertical-align: middle`](https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align). – phentnil Nov 04 '21 at 14:53
-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.

James Son
  • 1
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 03 '21 at 13:32