为什么 Bootstrap Toasts 是透明的但坚持内容? [英] Why is Bootstrap Toasts transparent but sticks to the content?
问题描述
我有一个 Bootstrap 5 站点和一个 Toasts,显示访问者何时离线.
我的 Toasts 位于页面底部并且已修复.如果您转到该页面并且 Toast 位于按钮上,则即使按钮未显示,它也会覆盖该按钮.如何通过将 Toast 放在内容的顶部来使 Toast 消失而不干扰页面?在Bootstrap文档的例子中就没有这个问题.
index.html :
<html lang="fr";class=h-100"><头><元字符集=utf-8"><元名称=视口"内容=宽度=设备宽度,初始比例=1">头部><body class="position-relative d-flex flex-column bg-dark text-white text-center";data-bs-spy=滚动"数据目标=#navbar";data-bs-offset=85"tabindex=0"><div class="toast-container position-fixed bottom-0 start-50 translate-middle-x mb-3"><div id="updateToast";class="toast d-none";角色=警报"aria-live=断言";aria-atomic=真"><div class="toast-header"><svg xmlns="http://www.w3.org/2000/svg";宽度=20"高度=20"填充=当前颜色"class="bi bi-arrow-repeat text-success";viewBox=0 0 16 16"><路径d="M11.534 7h3.932a.25.25 0 0 1 .192.41l-1.966 2.36a.25.25 0 0 1-.384 0l-1.966-2.36a.25.25 0 0 1 .192.41l-1.96611 2h3.932a.25.25 0 0 0 .192-.41L2.692 6.23a.25.25 0 0 0-.384 0L.342 8.59A.25.25 0 0 0 .534/9z<path fill-rule="evenodd";d=M8 3c-1.552 0-2.94.707-3.857 1.818a.5.5 0 1 1-.771-.636A6.002 6.002 0 0 1 13.917 7H12.9A530Z 7H12.9A530Z 0002 5.002 0 0 0 8.757 2.182.5.5 0 1 1 .771.636A6.002 6.002 0 0 1 2.083 9H3.1z"/></svg><strong class="me-auto">Mise à jour disponible</strong>
<div class="toast-body text-start text-dark">Cliquez ICI 倒mettre à jour.
<div id="offlineToast";类=吐司"角色=警报"aria-live=断言";aria-atomic=真"><div class="toast-header"><svg xmlns="http://www.w3.org/2000/svg";宽度=20"高度=20"填充=当前颜色"class="bi bi-wifi-off text-danger";viewBox=0 0 16 16"><路径d=M10.706 3.294A12.545 12.545 0 0 0 8 3C5.259 3 2.723 3.882.663 5.379a.485.485 0 0 .7.30510 0 0-.045 0 .7 .65 18 4 0 0 0 8 4 0.0481 8 4c.63 0 1.249.05 1.852.148l.854-.854zM8 6c-1.905 0-3.68.56-5.166 1.526a.48.48 0 0 0-.063.56525 0-.063.56525 0-.063.565 8 4 0.856 5 8 0-1.27L8 6zm2.596 1.404.785-.785c.63.24 1.227.545 1.785.907a.482.482 0 0 1 .063.745.525.525 ..063.745.525.525 . .525.525 . .525.525 . . 5 . 0 4 0 1 0 . 3 0 . 5 9 0 0 . 5 4 0 1 6 9 8 . 2 5 4 0 3 0 8 0 . 2 6 1 0 9 8 . 2 2 7.545 1.785.907a.482.482933a6.455 6.455 0 0 1 2.013.637c.285.145.326.524.1.75l-.015.015a.532.532 0 0 1-.611.09A5.478 .4078-4095-400000000000000000000000000000000000000000000000000000000000000000000000000000..645 1.685 1.03a.485.485 0 0 1 .047.737.518.518 0 0 1-.668.05 11.493 11.493 0 0 0-1.811-1.07z.123.0 0-1.811-1.07z.123.07.1.811-1.07z.123.07.16.123.07.16.165.1676723676726772376723767207-.707 0l-.707-.707c-.195-.195-.197-.518.04-.66A1.99 1.99 0 0 1 8 11.5c.374 0 .723.102 1.021.2555a.195-.197-.518.04-.66A1.990 1 .75.75l-10.75 10.75a.53.53 0 0 1-.75-.75l10.75-10.75z"/></svg><strong class="me-auto">Vous êtes hors-ligne</strong><按钮类型=按钮"类=btn-close";data-bs-dismiss=吐司";aria-label=关闭"></button>