我需要制作特定类的按钮和链接以相同的方式进行外观和定位。我尝试过这个(简体):
<html>
<head>
<title>My site</title>
<style>
.my-class {
display: inline-block;
background-color: #cccccc;
width: 18px;
height: 18px;
cursor:pointer;
box-sizing: border-box;
border: 1px solid #888888;
}
</style>
</head>
<body>
<a href="#" class="my-class" title="My link"></a>
<button class="my-class" type="submit" title="My button"></button>
</body>
</html>
但是链接的位置比按钮高一点:
<< [是否有一个跨浏览器的纯CSS的解决方案(没有javascript),可以将它们定位在同一级别上?
我的站点
...<body>
<div style="height:50px;line-height:50px">
<a href="#" class="my-class" title="My link"></a>
<button class="my-class" type="submit" title="My button"></button>
</div>
</body>