Когда я навещу ссылку, появится absolute pseudo element
.css абсолютный элемент спрятан переполнением: auto
Я делаю div overflow-y: scroll
, те pseudo element
внешний вид не может показать, они все еще использовали позицию без scroll
вычисляли.
У Chrome есть эта проблема, Firefox работает хорошо.
Вот два изображения:
.blog .widget-panel {
height: 400px;
width: 200px;
margin: 20px;
position: fixed;
}
.blog .widget-panel > div {
overflow-x: hidden;
overflow-y: auto;
height: 100%;
}
.blog .widget-panel .tag-box .tag-block {
display: block;
line-height: 28px;
border-bottom: 1px dotted rgba(0,0,0,0.1);
padding: 7px;
color: #666;
background-color: #fff;
}
.blog .widget-panel .tag-box .tag-block:hover,
.blog .widget-panel .tag-box .tag-block.selected {
background-color: #38B7EA;
color: #fff;
}
.blog .widget-panel .tag-box.block .tag-block[data-title]:hover:after {
content: attr(data-title);
position: absolute;
z-index: 20;
white-space: nowrap;
background: rgba(85,85,85, 0.9);
padding: 4px 8px;
color: #fff;
font-size: 14px;
line-height: 18px;
margin-top: 2.8em;
}
.blog .widget-panel .tag-box .tag-block .count{
float: right;
}
<div class="blog">
<div class="panel panel-default widget-panel">
<div class="tag-box block">
<a class="tag-block" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
All
<span class="count">14</span>
</a>
<a class="tag-block tag-test" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
test
<span class="count">7</span>
</a>
<a class="tag-block" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
All
<span class="count">14</span>
</a>
<a class="tag-block tag-test" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
test
<span class="count">7</span>
</a>
<a class="tag-block" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
All
<span class="count">14</span>
</a>
<a class="tag-block tag-test" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
test
<span class="count">7</span>
</a>
<a class="tag-block" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
All
<span class="count">14</span>
</a>
<a class="tag-block tag-test" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
test
<span class="count">7</span>
</a>
<a class="tag-block" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
All
<span class="count">14</span>
</a>
<a class="tag-block tag-test" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
test
<span class="count">7</span>
</a>
<a class="tag-block" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
All
<span class="count">14</span>
</a>
<a class="tag-block tag-test" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
test
<span class="count">7</span>
</a> <a class="tag-block" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
All
<span class="count">14</span>
</a>
<a class="tag-block tag-test" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
test
<span class="count">7</span>
</a> <a class="tag-block" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
All
<span class="count">14</span>
</a>
<a class="tag-block tag-test" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
test
<span class="count">7</span>
</a> <a class="tag-block" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
All
<span class="count">14</span>
</a>
<a class="tag-block tag-test" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
test
<span class="count">7</span>
</a> <a class="tag-block" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
All
<span class="count">14</span>
</a>
<a class="tag-block tag-test" href="#" data-title="A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article">
test
<span class="count">7</span>
</a>
</div>
</div>
</div>
Не используйте тот же идентификатор снова и снова на одной веб-странице, например '' 'Все-tags'''. Если вы устанавливаете '' 'position: absolute''' для любого div или тега и хотите показать его относительно родительского тега, вы должны установить' '' position: relative''' родительскому тегу. – aavrug
Спасибо. Когда я добавляю 'position: relative' к родительскому (' .tag-block'), он будет показывать горизонтальную полосу прокрутки, не показывая, как я хочу, тоже. – azlar
При добавлении 'position: relative;' to '.tag-block' будет скрывать заголовки' overflow'. как здесь: [https://jsfiddle.net/dp70zv5o/2/](https://jsfiddle.net/dp70zv5o/2/.) – azlar