我正在try 制作一个字形浏览器网页
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Glyph browser</title>
<style>
body {
background-color: black;
}
.gridcontainer {
margin-left: 3rem;
display: grid;
grid-template-columns: repeat(16, 1fr);
}
.gridcell {
color: white;
border: 0.1px solid gray;
padding: 1rem;
text-align: center;
}
p {
text-align: center;
margin: 2rem;
font-size: 1rem;
color: white;
}
p.unicode {
font-size: 0.5rem;
}
.glyph-pop {
display: none;
position: absolute;
z-index: 10;
}
.glyph-display {
font-size: 5rem;
}
.glyph:hover .glyph-pop
{
display: inline-block;
}
.glyph-pop p {
background-color: black;
font-size: 20rem;
color: orange;
}
.glyph-pop .unicode {
color: orange;
font-size: 2rem;
}
.glyph a {
font-style: normal;
font-weight: bold;
color: inherit;
text-decoration: none;
}
</style>
</head>
<body>
<h1>
Glyph browser
</h1>
<div class="gridcontainer">
<div class="glyph">
<p class="glyph-display" title="exclamation mark Punctuation, Other">
<a>!</a>
</p>
<p class="unicode">
0021
</p>
<div class="glyph-pop">
<p>
!
</p>
<p class="unicode">
U+0021
</p>
</div>
</div>
<div class="glyph">
<p class="glyph-display" title="exclamation mark Punctuation, Other">
<a>@</a>
</p>
<p class="unicode">
0022
</p>
<div class="glyph-pop">
<p>
@
</p>
<p class="unicode">
U+0022
</p>
</div>
</div>
<div class="glyph">
<p class="glyph-display" title="exclamation mark Punctuation, Other">
<a>#</a>
</p>
<p class="unicode">
0023
</p>
<div class="glyph-pop">
<p>
#
</p>
<p class="unicode">
U+0023
</p>
</div>
</div>
</div>
</body>
</html>
其 idea 是当用户将鼠标悬停在小版本上时,显示一个大字形.(尺寸可能会有所调整.)
它的工作正常,但我无法控制‘大’字形显示的位置,我不确定什么是可能的.理想情况下,我可以把较大的放在较小的下面.