gpt4 book ai didi

html - 通知未显示在特定按钮上

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

我有带有 span 类的按钮,我面临着在特定按钮上方显示每个 span 类的问题。喜欢这张图片This .我该怎么做?

.label{
position: absolute;
top: 2.5rem;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://use.fontawesome.com/f574067864.js"></script>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>

<body>
<hr>
<div class="container">
<button class="btn btn-default" type="submit">Button</button>
<span class="label label-success">4</span>

<button class="btn btn-default" type="submit">Button</button>
<span class="label label-success">5</span>

<button class="btn btn-default" type="submit">Button</button>
<span class="label label-success">6</span>
</div>
</body>
</html>

谢谢...

最佳答案

试试这个

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://use.fontawesome.com/f574067864.js"></script>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<style>
.sub-btn{
position: relative;
}
.sub-btn span{
position: absolute !important;
right: 0;
top: -15px !important;
}
</style>
<body>
<hr>
<div class="container">
<button class="btn btn-default sub-btn" type="submit">Button <span class="label label-success">4</span></button>


<button class="btn btn-default sub-btn" type="submit">Button <span class="label label-success">5</span></button>


<button class="btn btn-default sub-btn" type="submit">Button <span class="label label-success">6</span></button>

</div>
</body>
</html>

关于html - 通知未显示在特定按钮上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38328466/

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