svg+css布局实现提示效果代码
代码语言:html
所属分类:布局界面
代码描述:svg+css布局实现提示效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;700&display=swap"); body { align-items: center; background-color: #eef0f6; display: flex; font-family: "Source Sans Pro", sans-serif; justify-content: center; height: 100vh; } .card { align-items: center; background-color: #fff; border-radius: 20px; box-shadow: 0 0.4px 3.6px rgba(0, 0, 0, 0.004), 0 1px 8.5px rgba(0, 0, 0, 0.01), 0 1.9px 15.7px rgba(0, 0, 0, 0.019), 0 3.4px 28.2px rgba(0, 0, 0, 0.03), 0 6.3px 54.4px rgba(0, 0, 0, 0.047), 0 15px 137px rgba(0, 0, 0, 0.07); display: flex; flex-direction: column; position: relative; width: 336px; } .top { background-color: #eee; border-radius: 20px; margin: 16px 0; width: 260px; } .text { box-sizing: border-box; padding: 0 20px 20px; width: 100%; } .title { align-items: center; display: flex; font-size: 28px; font-weight: bold; margin-bottom: 4px; position: relative; } .tooltip { font-size: 16px; font-weight: normal; margin-top: 2px; position: relative; } .tooltip:hover { cursor: help; } .tooltip-spacing { height: 20px; margin: 8px; position: relative; width: 20px; } .tooltip-bg1 { background-color: #000; border-radius: 10px; content: " "; display: flex; height: 20px; position: absolute; top: 0; width: 20px; } .tooltip-bg2 { background-color: #fff; border-radius: 8px; content: " "; display: flex; height: 16px; left: 2px; position: absolute; top: 2px; width: 16px; } .tooltip-text { font-size: 14px; font-weight: bold; line-height: 20px; position: relative; text-align: center; width: 20px; } .info { color: #64686b; } .popup-bg { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.16)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.23)); position: absolute; top: -126px; } .popup-outline { position: absolute; top: -126px; } .popup-text { border-radius: 12px; box-sizing: border-box; color: #fff; font-size: 16px; font-weight: normal; left: 8px; opacity: 0; padding: 12px 16px; position: absolute; top: -117px; transition: opacity 240ms 120ms cubic-bezier(0.4, 0, 0.2, 1); width: 292px; } .tooltip:hover ~ .popup-text { display: block; } .popup-bg { opacity: 0; transition: opacity 240ms 120ms cubic-bezier(0.4, 0, 0.2, 1); } .popup-outline-left { stroke-dasharray: 0 426px; stroke-dashoffset: 1px; transition: stroke-dasharray 300ms cubic-bezier(0.4, 0, 0.2, 1); } .popup-outline-right { stroke-dasharray: 352px 352px; stroke-dashoffset: -352px; transition: stroke-dashoffset 300ms cubic-bezier(0.4, 0, 0.2, 1); } .tooltip:hover ~ .popup-text { opacity: 1; } .tooltip:hover ~ .popup-bg { opacity: 1; transition: opacity 240ms 120ms cubic-bezier(0.4, 0, 0.2.........完整代码请登录后点击上方下载按钮下载查看
网友评论0