css如何制作搜索图标

 时间:2024-10-12 03:27:14

1、打开html开发软件,新建一个html页面。如图:

css如何制作搜索图标

3、设置class类样式。搜索小图标是由一个小圆+一条斜线组成,所有需要设置class类样式创建一个小圆圈。创建小圆圈样式代码:<style> .icon-search{ width: 12px;height: 12px; border-radius: 100%; border:2px solid currentcolor; position: relative; margin:30px auto; } </style>

css如何制作搜索图标

5、对class类添加斜杠。使用 css伪类:after为小圆圈添加一条斜杠。如图:添加斜杠样式css代码:.icon-s髫潋啜缅earch:after{ content: ""; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); transform: rotate(45deg); width:8px; height: 2px; position: absolute; top:13px; left:11px; background-color: currentcolor; }

css如何制作搜索图标

7、页面所有代码。可以直接复制所有代码到新建html页面,粘贴保存后使用浏览器打开即可看到页面效果。所有代洁船诼抨码:<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>css搜索图标</title> <style> .icon-search{ width: 12px;height: 12px; border-radius: 100%; border:2px solid currentcolor; position: relative; margin:30px auto; } .icon-search:after{ content: ""; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); transform: rotate(45deg); width:8px; height: 2px; position: absolute; top:13px; left:11px; background-color: currentcolor; } </style> </head> <body> <div class="icon-search"></div> </body></html>

  • jquery跳转页面的方法
  • 利用jquery写出鼠标悬停在一张图片上放大图片
  • CSS中,当鼠标移到层上,层怎么显示出边框?
  • 如何在IntelliJ IDEA中导入mysql的驱动jar包
  • 如何他用powerdesigner中的SQL语句创建数据表
  • 热门搜索
    饭后运动 什么星座最有钱 among是什么意思 分数的意义是什么 什么叫朋友 养殖大棚 eve什么意思 抗维生素d佝偻病 蚂蚁花呗是什么意思 熟视无睹是什么意思