在我的侧边栏中没有显示任何文字。这就是我看到的Sidebar
.sidebar{
background-color: cornflowerblue;
padding: 100% 5%;
position: fixed;
top: 0;
right: 0;
float: right;
}
<div class="sidebar">
<h1>Sales</h1>
</div>
答案 0 :(得分:3)
您过度填充了文本。您已将padding设置为100%,即页面宽度的100%,这是针对仅占据页面20%的元素的,因此,文本可能离屏幕很远。您可能不想要这个。
在这里,我已将其更新为0%,现在显示该文本,因此您现在可以根据需要正确设置填充...
.sidebar{
background-color: cornflowerblue;
padding: 0% 5%;
position: fixed;
top: 0;
right: 0;
float: right;
}
<div class="sidebar">
<h1>Sales</h1>
</div>