Posted in CSS
4870
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
51
This Month
153
This Year
821

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
I believe that in order to better your knowledge base, it takes a lot of failing in order to succeed. I don't consider anything a failure as long as you get back up and you learn from your own mistakes.
Unknown
Random CSS Property

@keyframes

The @keyframes CSS at-rule controls the intermediate steps in a CSS animation sequence by defining styles for keyframes (or waypoints) along the animation sequence. This gives more control over the intermediate steps of the animation sequence than transitions.
@keyframes css reference