This zone is sleeping right now! ZzzZZzzz

Better not distrub it! ~You go to the petrol station and buy a slushy instead, everything is cool!~

This area will open again in 000.beats!

(Learn about Swatch Time)

Some other zones are awake :^]


Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining MelonLand?
May 18, 2026 - @519.10 (what is this?)
Activity rating: Four Stars Posts & Arts: 50/1k.beats Random | Recent Posts | Guild Recents
News: :skull: Websites are like whispers in the night  :skull: Guild Events: Spring Themed Projects

+  MelonLand Forum
|-+  Life & The Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  lining up clickable elements on a background


« previous next »
Pages: [1] Print Embed
Author Topic: lining up clickable elements on a background  (Read 642 times)
candycanearter07
Hero Member ⚓︎
*****
View Profile WWWArt


i like slimes
⛺︎ My Room
SpaceHey: Friend Me!
StatusCafe: candycanearter
Itch.io: My Games
RSS: RSS

Guild Memberships:
Artifacts:
it's tbhchansey!Goomy, I Choose You!Suck At Something September - Did It!uh oh! a pigeon got in!Artsy Candy Cane
« on: November 01, 2024 @504.81 » Embed

hi,

does anyone know how to "properly" line up clickable elements on a background in a way that it doesn't break on resize? the only things that I can think of would be to have each "clickable" thing in the image as a separate <img> tag and use like a div (which im not sure how to set up with having the background image also line up and not relying on stretch image scaling) or by using a map which completely breaks if your image can be scaled (which if its a fullscreen image it will)

so any advice here?
Logged

new to oldnet be nice
https://status.cafe/users/candycanearter/badge.png https://abslimeware.neocities.org/assets/images/blinkers/penguins.gif

https://abslimeware.neocities.org/assets/images/blinkers/slimebounce.gif https://card.exophase.com/2/0/268504.png?1727352149

https://i.imgur.com/S1cx8ZZ.pnghttps://i.imgur.com/7ntZZGM.pnghttps://i.imgur.com/xKIpW2A.pnghttps://i.imgur.com/YMPbu9R.png

Artifact Swap: charry zardshoeDS Lover (replacement)Ball Creaturecards all the way down
shortround
Newbie
*
View Profile


⛺︎ My Room

Artifacts:
Joined 2024!
« Reply #1 on: November 02, 2024 @66.53 » Embed

You can set the position and height of elements using percentages. If your parent element is, say, 400x300, and you say add another element that is 10% wide by 20% high, the child element will be 40x60. If you resize the parent element, the child element will maintain its size relative to the parent

If I'm not explaining it well, here's an example:

https://jsfiddle.net/ty94fnek/2/

The size and position of the <a> links are set as percentages (relative to the parent; the picture of the cat). In the second image, I've resized the cat, but the <a> links appear in the correct place and correct size, since the percentages are the same.

I am using absolute positioning for the <a> links, so the parent element needs to be position: relative as well.

Let me know if I'm not being clear
Logged
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | ~ Send Feedback ~ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
MelonLand @000

Want to Login or Join ?

Minecraft: Online
Join: craft.melonking.net