当javascript改变两个标签的宽度时,它们会自动改变位置
two labels changes positions automitic when their width change by javascript
我在锚点标签中有标签:
<a href="#" runat="server" id="Anchor" class="class1"><span><asp:label ID="label1" runat="server" ForeColor="White" Font-Size="Smaller" Text=text1" >
以及包含用户名的CCD_ 1。我想要的是当label2
根据用户名调整其宽度时,label1
根据label1
自动调整其位置。在这里,当用户名类似于"ttttttttttltttttttt"时,我遇到了一个问题——在label1
对齐之后,但当用户名较小,如"ttttt"时,标签之间会显示很大的空间。
.class1
{
position: absolute;
z-index: 4;
top: 65px;
right: 43.3%;
/*left: 30.6%;*/
-webkit-tap-highlight-color: transparent;
}
body.reversed .class1 {
left: 8px;
right: auto;
}
.fixed-title-bar > .class1 {
position: fixed;
}
.class1 > span {
padding: 0 8px 0 30px;
background: url(../img/inout5.png) no-repeat 7px center;
font-size: 16px;
height: 27px;
line-height: 27px;
}
.class1 > span {
display: block;
border: 1px solid #020203;
color: white;
-webkit-text-shadow: 0 -1px 0 black;
-moz-text-shadow: 0 -1px 0 black;
text-shadow: 0 -1px 0 black;
background-color: #454545;
background-color: rgba(255, 255, 255, 0.3);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 rgba(255, 255, 255, 0.25);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 rgba(255, 255, 255, 0.25);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 rgba(255, 255, 255, 0.25);
-webkit-background-clip: padding-box;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
width:56px;
}
通过一些CSS设置和ul-li标签
相关文章:
- Javascript改变位置赢得'不适用于Chrome或IE
- 最大宽度正在改变位置:固定边距
- 当javascript改变两个标签的宽度时,它们会自动改变位置
- Bootstrap popover以分辨率改变位置
- JavaScript:检测窗口开始改变位置的时刻
- 改变位置引导-wysihtml5
- 如何在动画完成后随机改变位置
- Jquery背景改变位置的步骤
- LeafletJS:获取一个特定的标记来改变位置
- 相位定时器不改变位置对象,只改变位置值
- 改变位置.在重新加载页面时散列
- 在D3散点图中,点在放大时改变位置
- 如何改变位置和z-索引使用jquery(动画)
- Gmaps.js - zoomControlOpt不会改变位置或样式
- JQuery根据位置显示元素——如果父元素不在屏幕上,工具提示应该改变位置
- 改变位置.在unbeforeunload上散列
- 离子改变位置不起作用
- 不改变位置的Angular路由
- 当使用setPosition改变位置时,谷歌标记消失
- 如果高度超过100px,改变位置