我坚持这个小问题,非常愚蠢我知道,但我找不到配置-css来解决问题(位置相对margin-left,padding-left,没有一个工作)
问题:在此div中添加一个填充 - sidebar-user-div11
.sidebar-user{
position: relative;
width: 100%;
background-color: #ff7801;
background: #ff7801;
}
.sidebar-user-div1{
/*position: relative;*/
width: 100%;
height: 40px;
background-color: purple;
}
.sidebar-user-div2{
/*position: relative;*/
width: 100%;
height: 30px;
background-color: yellow;
}
.sidebar-user-div11{
/*position: relative;*/
float: left;
width: 80%;
height: 40px;
line-height: 40px;
/*margin-left: 15px;*/
color: white;
background-color: red;
padding-left: 10px;
}
.sidebar-user-div12{
/*position: relative;*/
float: left;
width: 20%;
height: 40px;
background-color: black;
}
<div class="sidebar-user">
<div class="sidebar-user-div1">
<div class="sidebar-user-div11">
Text with padding left :(
</div>
<div class="sidebar-user-div12">
</div>
</div>
<div class="sidebar-user-div2">
</div>
</div>