1、打开html开发软件,在html开发工具中新建一个html代码页面。
2、新建一个<div>标签,然后给这个<div>添加一个class类为icon-map。
3、制作底部为尖角的圆。创建<style>标签,然后在该标签里面设置icon-map类样式底部为尖角的圆。css代码:.icon-罪焐芡拂map{ color:#333; width:30px;height:30px; margin:30px auto; border:solid 2px currentColor; border-radius:16px 16px 16px 0; -webkit-transform:rotate(-45deg); -moz-transform: ratate(-45deg); transform:rotate(-45deg); }
4、保存html代码,然后使用浏览器打开,即可在浏览器上看到底部为尖角的圆。
5、回到html代码页面,使用after伪类对icon-map设置一个小圆,然后使用postion把小圆放到尖角圆居中的位置。css代码:.icon-map:after{ content: ""; width: 8px; height: 8px; border:2px solid currentcolor; position: absolute; top:9px; left:9px; border-radius: 100%; }
6、保存html代码,然后使用浏览器打开,就可以看到浏览器页面上显示一个地图定位的小图标。
7、页面所有代码。可以直接复制所有代码,粘贴到新建html页面保存后使用浏览器打开即可看到效果。所有代码:媪青怍牙<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>地图定位图标 </title> <style> .icon-map{ color:#333; width:30px;height:30px; margin:30px auto; border:solid 2px currentColor; border-radius:16px 16px 16px 0; -webkit-transform:rotate(-45deg); -moz-transform: ratate(-45deg); transform:rotate(-45deg); } .icon-map:after{ content: ""; width: 8px; height: 8px; border:2px solid currentcolor; position: absolute; top:9px; left:9px; border-radius: 100%; } </style> </head> <body> <div class="icon-map"></div> </body></html>