gpt4 book ai didi

html - 使用 css 在所有支持的浏览器中居中文本

转载 作者:太空宇宙 更新时间:2023-11-03 19:20:30 25 4
gpt4 key购买 nike

我有这个片段:查看here编辑 here

如何让“x”在所有支持的浏览器(至少是 firefox3+ 和 chrome)上保持在圆圈的中间

片段:

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Backbone: Tody</title>

<style>
.delete {
-moz-border-radius: .75em;
-webkit-border-radius: .75em;
width: 1.4em;
height: 1.4em;
text-align: center;
display: inline-block;
line-height: 1.4em;
display:inline-block
vertical-align:middle
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
font-weight: bold;
color: white;
background-color: gray;
cursor: pointer;
}
.delete:before {
content: "\2715";
/* content: "\00D7"; */
}
.delete:hover {
background-color: red;
}
</style>

</head>
<body>

<div class="delete"></div>

</body>
</html>

最佳答案

如果您希望它在所有浏览器中像素完美,最好的办法可能是使用图像——x 的位置将取决于不同浏览器中的默认字体大小。

也就是说,我会说它在 OS X 上的 FF4b 和 Chrome 7 中已经足够接近了......

关于html - 使用 css 在所有支持的浏览器中居中文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4179235/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com