Posted in CSS
4887
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
68
This Month
170
This Year
838

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
Many of life's failures are people who did not realize how close they were to success when they gave up.
Thomas A. Edison
Random CSS Property

border-block-color

The border-block-color CSS property defines the color of the logical block borders of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-color and border-bottom-color, or border-right-color and border-left-color property depending on the values defined for writing-mode, direction, and text-orientation.
border-block-color css reference