This zone is sleeping right now! ZzzZZzzz

Better not disturb 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?
a Summer day - @549.27
Activity rating: Two Stars Posts & Arts: 22/1k.beats Random | Recent Posts | Guild Recents
News: :skull: Websites are like whispers in the night  :skull: Guild Events: There are no events!

+  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 741 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:
Visited on Melon's 10th Anniversary!it's tbhchansey!Goomy, I Choose You!uh oh! a pigeon got in!Artsy Candy Cane
« on: an Autumn day » 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: cuptain soldierbuzzystickershoeBlob Creaturecards all the way downCommon Slorg
shortround
Newbie
*
View Profile


⛺︎ My Room

Artifacts:
Joined 2024!
« Reply #1 on: an Autumn night » 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 | Supporters ♥ 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
@000 MelonLand Editor Recent Edits Tenement Arcade Want to Login or Join ? Forum Art Hub Chat Webring Web Guides Graphics Catalogue Wiki Newsletters Image Stream
Melon's Sites TamaNotchi Textures PixelSea GifyPet MoMG Ozwomp Online Loom Videos Leaky Webring Melonking
Tools Melon Software ArtHub Embed Maker ML Passports
Outlinks Frutiger Aero Forum Onio Club m15o's Web Services 32Bit Cafe iMood Webrings Internet Phone Book HTML Energy Declarations Hackers & Designers
Zap!
Minecraft: Online
Join: craft.melonking.net