gpt4 book ai didi

html - 内联显示按钮和标签

转载 作者:搜寻专家 更新时间:2023-10-31 22:41:33 24 4
gpt4 key购买 nike

我想在同一行显示按钮和标签。但不同行显示多个按钮。我该怎么做。帮助将不胜感激。按钮和标签应该并排放置,下一行的下一组按钮和标签。我哪里出错了?

 <!DOCTYPE html>
<html>
<head>
<title>test</title>
<style type="text/css">

.round-button
{
width:20px;


}
.round-button-circle {
width: 100%;
height:0;
padding-bottom: 100%;
border-radius: 50%;

overflow:hidden;

background: #4679BD;
box-shadow: 0 0 3px gray;

}
.round-button-circle:hover {
background:#30588e;
}
.round-button a {

width:100%;
padding-top:50%;
padding-bottom:50%;
line-height:1em;
margin-top:-0.5em;

text-align:center;
color:#e2eaf3;
font-family:Verdana;
font-size:1.2em;
font-weight:bold;
text-decoration:none;
}





</style>
</head>
<body>


<br><span ><div class='round-button'><div class='round-button-circle'></div></div> <label style='display:inline;'>edit</label></span>

<br><span ><div class='round-button'><div class='round-button-circle'></div></div> <label style='display:inline;'>edit</label></span>

</body>
</html>

最佳答案

使用 display:table-cell 会给你预期的输出。

<span>
<div class='round-button'><div class='round-button-circle'></div></div>
<label class="lblname" >edit</label>
</span>

<span >
<div class='round-button'><div class='round-button-circle'></div></div>
<label class="lblname">edit</label>
</span>

CSS:

.round-button 
{
width:20px;
display: table-cell;
}

.lblname{
display: table-cell;
padding: 0 5px;
vertical-align: middle;
}

Working Fiddle

注意:尽量避免提供内联 css。

关于html - 内联显示按钮和标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34282512/

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