0

I am completelly new to html and I need some quick help. I got this image here: enter image description here

I want to add some clickable texts that contains links when you click on them like this: enter image description here

How do I place clickable text on image and how can I make it change font color when a cursor is hovering on top of it.

Would greatly appreciate help on this. I can't figure out how do I add stuff on top of the image.

Thanks

EDIT:

I am trying to add the clickable links with: <a href="google.com">Text</a> But I can't figure out how to move it around so it just sits there under image like this:

This is what I got right now:

<div class="container">
  <img src="https://growingseedsavers.org/content/images/2021/11/asd.png" alt="Snow">
</div>
<body>
<a href="google.com">Text</a>

</body>
  • if your image is only about design, it can be a background, then the links can be in a list on top of it. **Have you tried anything yet ?** – G-Cyrillus Nov 17 '21 at 20:00
  • Please provide any HTML and CSS. – Kameron Nov 17 '21 at 20:01
  • 1
    Take a look at the [image map element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map) as well. – Rob Moll Nov 17 '21 at 20:03
  • @RobMoll , it won't do the text color on hover ;) – G-Cyrillus Nov 17 '21 at 20:05
  • @G-Cyrillus - With great respect: [SO answer](https://stackoverflow.com/questions/8343531/is-it-possible-to-style-a-mouseover-on-an-image-map-using-css) – Rob Moll Nov 17 '21 at 20:10
  • @RobMoll, no worries , chrome can show areas and even restyle text colors for a while, https://codepen.io/gcyrillus/pen/AJHmt (8years old pen) , but firefox still does not , so yes , with chome you change text-color on hover , but on firefox, there is nothing to see ;) – G-Cyrillus Nov 17 '21 at 20:29
  • You should also share your HTMl and attemps, so we can help from there. – G-Cyrillus Nov 17 '21 at 20:41

1 Answers1

1

From a single image used as a background and nowdays CSS possibilities, you can lay over it any tags enter image description here

here is an example using flex, grid and aspect-ratio and background . it can also wrap and you can add as many boxes as you need.

section {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5%;
}

div {
  background: url(https://i.stack.imgur.com/r13qs.png);
  width: 205px;
  aspect-ratio: 1/1.6;
  display: grid;
  grid-template-rows: 140px 1fr;
}

div h2 {
  margin-top: auto;
  padding-inline: 3ch;
  text-align: center;
}

div ul {
  padding: 0;
  margin: 0 0 25%;
  list-style: none;
}

li {
  font-weight: 900;
  padding-inline: 5ch;
}

li::before {
  content: "- ";
}

li a {
  color: inherit;
  text-decoration: none;
}

li a:hover {
  color: #834C61
}
<section>
  <div>
    <h2>TEXT</h2>
    <ul>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
    </ul>
  </div>
  <div>
    <h2>TEXT</h2>
    <ul>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
    </ul>
  </div>
  <div>
    <h2>TEXT</h2>
    <ul>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
    </ul>
  </div>
  <div>
    <h2>TEXT</h2>
    <ul>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
    </ul>
  </div>
  <div>
    <h2>TEXT</h2>
    <ul>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
      <li><a href="#">CT</a></li>
    </ul>
  </div>
</section>
G-Cyrillus
  • 101,410
  • 14
  • 105
  • 129
  • Sorry for my incompetence but when I paste both things into HTML window, the first one remains as text but the second part works and creates the clickable texts. I tried adding the image source but it remained as text. Do I need something else to fix the syntax? – Benedicts Forester Nov 17 '21 at 21:12
  • @BenedictsForester the first part you see in the snippets is CSS. it has to be wrapped inside a style tag `` to be undersood by the browser as a style sheet or stored inside a css file `mystyle.css`and linked from the ``tag of your document. You should definitely look for the basics tutorials. You can (re)start from here https://stackoverflow.com/tags/css/info and possibly here https://www.htmldog.com/guides/css/beginner/applyingcss/ . – G-Cyrillus Nov 17 '21 at 21:51