Posted in CSS
4912
12:44 am, August 24, 2022
 

Map Image with Easy Dots and Titles using only CSS

I had to quickly add some dot points with names to a map the other day, so i thought i should probably look for a jquery library for tool tips or something similar. But then i thought why not just add these elements as CSS and then utilize the hover attribute to hide and show the labels. 

Read the full details of this code over here

HTML

<div class='map-wrap'>
  <div class='map-dot map-dot-1'>
    <div class='dot-content'>
      KruXoR 1
    </div>
  </div>
  <div class='map-dot map-dot-2'>
    <div class='dot-content'>
      KruXoR 2
    </div>
  </div>
</div>

CSS

.map-wrap * {
	font-family:sans-serif;
}
.map-wrap {
	background:url(https://i.imgur.com/qHVGYKx.jpeg) center no-repeat;
	background-size:cover;
	height:500px;
	width:800px;
	margin:0 auto;
	position:relative;
}
.map-dot:hover .dot-content {
  display:block!important;
}
.dot-content {
  background:rgba(255,255,255,0.8);
  padding:10px;
  border-radius:10px;
  box-shadow:1px 1px 10px rgba(0,0,0,0.3);
  min-width:150px;
  font-size:14px;
  text-align:center;
	display:none;
	font-weight:bold;
  color:#444;
}
.map-dot:hover {
  background:rgba(255,255,255,0.0);
}
.map-dot {
  background:rgba(255,255,255,0.5);
  border-radius:20px;
	height:30px;
	width:30px;
	position:absolute;
}
.map-dot-1 {
	top:374px;
	left:212px;
}
.map-dot-2 {
	top:10%;
	left:10%;
}
KruXoR 1
KruXoR 2

External Link for Map Image with Easy Dots and Titles using only CSS

View Statistics
This Week
35
This Month
195
This Year
863

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
When I realized that, no individual step is hard in any process. Building this airport I'm standing in right now started with a guy writing the architectural plans on paper. That's not hard for him to do. Then laying the first beam isn't had. The whole thing is really hard. So, just take each step kind of piece by piece and when I was able to do that and stop trying to chase this prize and started putting in the work, things just started coming together.
Unknown
Random CSS Property

:read-write

The :read-write CSS pseudo-class represents an element (such as input or textarea) that is editable by the user.
:read-write css reference