• Latest
  • Trending
  • All
  • News
  • Business & Finance
  • Politics
  • Science & Technology
  • World
  • Lifestyle
  • Tech

Revisiting Image Maps

May 18, 2025
You Don’t Qualify: How Structural Obstacles Silenced Women in the 2026 Race

You Don’t Qualify: How Structural Obstacles Silenced Women in the 2026 Race

December 6, 2025
Unsafe Media: Ugandan Children Increasingly Vulnerable to Online Sexual Exploitation

Unsafe Media: Ugandan Children Increasingly Vulnerable to Online Sexual Exploitation

November 19, 2025
Women Leaders Trained in Digital Skills Ahead of Uganda’s 2026 Elections

Women Leaders Trained in Digital Skills Ahead of Uganda’s 2026 Elections

November 21, 2025
Mafabi Promises Equal Pay for Teachers and Better Services as FDC Campaign Gains Momentum

Mafabi Promises Equal Pay for Teachers and Better Services as FDC Campaign Gains Momentum

October 20, 2025
Left Behind Twice: Why the Uganda Women Entrepreneurship Programme (UWEP) Rarely Reaches Women Living with Disabilities

Left Behind Twice: Why the Uganda Women Entrepreneurship Programme (UWEP) Rarely Reaches Women Living with Disabilities

September 28, 2025

Protein Frozen S’mores (Viral Recipe)

September 10, 2025

Green Goddess Salad (Viral Recipe)

September 10, 2025

Easy Homemade Pizza Sauce

September 10, 2025

Cottage Cheese Waffles

September 10, 2025

Buffalo Chicken Wrap

September 10, 2025

Chocolate Protein Pancakes

September 10, 2025

5-Minute Cottage Cheese Toast (6 Ways)

September 10, 2025
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Sunday, December 7, 2025
  • Login
Uganda Multimedia News & Information
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
  • Business & Finance
    • Agriculture
    • Business & Economics
    • Business news
    • Finance & Accounting
    • Business & Management
    • Cars & Gadgets
  • Culture & Heritage
    • Arts & Beauty
      • Art
      • Beauty
    • Church
  • Education
    • Education subjects
    • E-Books
    • Agriculture
    • Books & Publications
    • Career
    • Education news
    • Education & Students
    • Civil Society jobs
    • Jobs
    • Full Time Jobs
    • Engineering jobs
  • Entertainment
    • Funny
  • Gaming
    • Boxing
    • Athletics
    • Cricket
    • Champions League
    • Cycling
  • Latest Uganda News
    • Justice
    • Human Rights
No Result
View All Result
Uganda Multimedia News & Information
No Result
View All Result
Home Jobs

Revisiting Image Maps

by Gerald Businge
May 18, 2025
in Jobs
0
492
SHARES
1.4k
VIEWS
Share on FacebookShare on XShare on WhatsApp

Let’s run through a quick refresher. Image maps date all the way back to HTML 3.2, where, first, server-side maps and then client-side maps defined clickable regions over an image using map and area elements.


Revisiting Image Maps originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Ten divs walk into a bar:

<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>

There’s not enough chairs for them to all sit at the bar, so you need the tenth div to sit on the lap of one of the other divs, say the second one. We can visually cover the second div with the tenth div but have to make sure they are sitting next to each other in the HTML as well. The order matters.

<div>1</div>
<div>2</div>
<div>10</div><!-- Sitting next to Div #2-->
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>

The tenth div needs to sit on the second div’s lap rather than next to it. So, perhaps we redefine the relationship between them and make this a parent-child sorta thing.

<div>1</div>
<div class="parent">
  2
  <div class="child">10</div><!-- Sitting in Div #2's lap-->
</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>

Now we can do a little tricky positioning dance to contain the tenth div inside the second div in the CSS:

.parent {
  position: relative; /* Contains Div #10 */
}

.child {
  position: absolute;
}

We can inset the child’s position so it is pinned to the parent’s top-left edge:

.child {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
}

And we can set the child’s width to 100% of the parent’s size so that it is fully covering the parent’s lap and completely obscuring it.

.child {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%;
}

Cool, it works!

Anchor positioning simplifies this process a heckuva lot because it just doesn’t care where the tenth div is in the HTML. Instead, we can work with our initial markup containing 10 individuals exactly as they entered the bar. You’re going to want to follow along in the latest version of Chrome since anchor positioning is only supported there by default at the time I’m writing this.

<div>1</div>
<div class="parent">2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div class="child">10</div>

Instead, we define the second div as an anchor element using the anchor-name property. I’m going to continue using the .parent and .child classes to keep things clear.

.parent {
  anchor-name: --anchor; /* this can be any name formatted as a dashed ident */
}

Then we connect the child to the parent by way of the position-anchor property:

.child {
  position-anchor: --anchor; /* has to match the `anchor-name` */
}

The last thing we have to do is position the child so that it covers the parent’s lap. We have the position-area property that allows us to center the element over the parent:

.child {
  position-anchor: --anchor;
  position-area: center;
}

If we want to completely cover the parent’s lap, we can set the child’s size to match that of the parent using the anchor-size() function:

.child {
  position-anchor: --anchor;
  position-area: center;
  width: anchor-size(width);
}

No punchline — just one of the things that makes anchor positioning something I’m so excited about. The fact that it eschews HTML source order is so CSS-y because it’s another separation of concerns between content and presentation.


Anchor Positioning Just Don’t Care About Source Order originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Share197Tweet123Send
Gerald Businge

Gerald Businge

  • Trending
  • Comments
  • Latest

List of winners of Pearl of Africa Music PAM Awards 2010

November 8, 2010

Minister calls for legalization of abortion

April 3, 2014
Full list of Buganda Katikkiros’ from 1889 to 2015

Full list of Buganda Katikkiros’ from 1889 to 2015

January 11, 2015

The Belgium Scholarship Programme for Uganda

114

Undergraduate Courses Programs offered at Makerere University

86

Ministry of defense to recruit 3000 UPDF Cadet Officers

32
You Don’t Qualify: How Structural Obstacles Silenced Women in the 2026 Race

You Don’t Qualify: How Structural Obstacles Silenced Women in the 2026 Race

December 6, 2025
Unsafe Media: Ugandan Children Increasingly Vulnerable to Online Sexual Exploitation

Unsafe Media: Ugandan Children Increasingly Vulnerable to Online Sexual Exploitation

November 19, 2025
Women Leaders Trained in Digital Skills Ahead of Uganda’s 2026 Elections

Women Leaders Trained in Digital Skills Ahead of Uganda’s 2026 Elections

November 21, 2025
Uganda Multimedia News & Information

Copyright © 2025 Ultimate Multiemdia Consult.

Navigate Site

  • About
  • Advertise
  • Privacy & Policy
  • Contact

Follow Us

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • Home
  • News
    • Politics
    • Business
    • World
    • Science
  • Entertainment
    • Gaming
    • Music
    • Movie
    • Sports
  • Tech
    • Apps
    • Gear
    • Mobile
    • Startup
  • Lifestyle
    • Food
    • Fashion
    • Health
    • Travel

Copyright © 2025 Ultimate Multiemdia Consult.

Go to mobile version