Ask coding questions

← Back to all posts
Relocating text
francescopalone (0)

Hi guys, i was making an html project, and i wanted to write subtitles for every image, but i don't know how to relocate a specific text to a specific position (for exemple on the right of an image).
Any hints?

Comments
hotnewtop
notGilbert (40)

You'll need CSS if you want to position elements on a page

example (using flexbox):

<div id="flex-container">
  <img src="...">
  <p>insert caption here</p>
</div>
#flex-container {
  display: flex;
  /* you can play around with flex properties to get it how you like */
}

by default, the flex would be horizontal
complete guide to flex

SixBeeps (5037)

You need CSS for that, and the CSS code you need will be different depending on what exactly you want to accomplish.

francescopalone (0)

@SixBeeps so, for example, if i want to relocate the text under an image, what do i have to do?