Bootstrap всплывающее окно не на кнопке - PullRequest
0 голосов
/ 13 июля 2020

У меня странная проблема, когда всплывающее окно отключается от кнопки. Я воссоздал проблему в Fiddle , но не смог определить источник проблемы. Я не знаю, какая часть CSS вызывает проблемы. Вот код, который создает кнопку, но я не связал CSS, потому что он довольно длинный и по большей части не связан с всплывающими окнами, но его можно увидеть в Fiddle.

<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<div class="row">    
    <div class="container offset-3 col-4 mt-5" style="height:200px;">
        <a tabindex="0" class="btn btn-primary" data-placement="left" role="button" data-html="true" data-toggle="popover" title="Incorrect Info"
           data-content="And here's some amazing content. It's very engaging. Right?">
            Incorrect Info?
        </a>
    </div>
</div>

Смещение всплывающего окна

1 Ответ

1 голос
/ 13 июля 2020

Это из-за маржи, которую вы установили для тега html.

  $(document).ready(function () { //enables popover
        $('[data-toggle="popover"]').popover();
    });
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */

/*Mobile or desktop specific stuff */

content-mobile {
    display: none;
}

content-desktop {
    display: none;
}

.nogap {
    margin: 0px;
    padding: 0px;
}

.indent {
    text-indent: 3rem;
}

center {
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}


/* Month */
table {
    border-collapse: collapse;
    font-family: 'Segoe UI', Times, serif;
}

th {
    border: 1px solid #A8A8A8;
    vertical-align: top;
}

td {
    height: 1.2em;
    width: 10em;
    padding: 8px;
    border: 1px solid #A8A8A8;
    vertical-align: top;
}

.divcalendar {
    padding: 15px;
    float: left;
    /*background-color: #FFCC00;*/
}

/* Wrapper div. That makes the inner div into an inline element that can be centered with text-align.*/
#calendaroverallcontrols {
    text-align: center;
}

/* This is a fluid div as width will be changing */
#calendarmonthcontrols {
    display: inline-block;
    /*background-color: #FF0000;*/
}

    #calendarmonthcontrols > div, #calendarmonthcontrols > a {
        display: inline-block;
    }

#prevmonthdates, #nextmonthdates {
    background-color: #808080;
}


@media (min-width: 25em) {

    html, body {
        overflow-x: hidden;
    }

    body {
        position: relative;
    }
}

hr.blueline {
    border: none;
    height: 2px;
    /* Set the hr color */
    color: #314DB2; /* old IE */
    background-color: #314DB2; /* Modern Browsers */
}


/*Index page */
.body {
    padding: 70px;
    margin: 0px;
}

.home.jumbotron {
    background-size: cover !important;
    border-radius: 0px !important;
    padding-top: 11rem !important;
    padding-bottom: 2rem !important;
    margin-top: 0px !important;
}

@media (max-width: 480px) {
    .home.jumbotron {
        padding-bottom: 70px;
    }
}

/*card columns */
@media (min-width: 20em) {
    .card-columns {
        -webkit-column-count: 2;
        -moz-column-count: 2;
        column-count: 2;
    }
}

@media (min-width: 48em) {
    .card-columns {
        -webkit-column-count: 3;
        -moz-column-count: 3;
        column-count: 3;
    }
}

@media (min-width: 62em) {
    .card-columns {
        -webkit-column-count: 4;
        -moz-column-count: 4;
        column-count: 4;
    }
}

@media (min-width: 75em) {
    .card-columns {
        -webkit-column-count: 4;
        -moz-column-count: 4;
        column-count: 4;
    }
}
/*Navbar */
a.navbar-brand {
    white-space: normal;
    text-align: center;
    word-break: break-all;
    background-size: contain;
}

.navbar-brand span {
    vertical-align: middle;
    padding: 0 0 0 15px;
}

/* changing color and underline on hover */
.navbar-nav .nav-item.active .nav-link,
.navbar-nav .nav-item:hover .nav-link {
    text-decoration: underline !important;
}

/* depressing navbar link based on what page user is on */
.onpage {
    text-decoration: none;
    background-color: #2B3035;
    border-radius: 3px;
}
/* test 12 */
.test12.jumbotron {
    background-color: transparent !important;
    color: white;
}
/* Timeline Layout */
.week {
    background-color: #dedede;
    border: 0px;
    border-left: 1px solid black;
    border-right: 1px solid black;
    border-radius: 0px;
    padding-top: 1px;
    height: 30px;
    cursor: pointer !important;
}

#imposedline {
    border-top: 1px solid black;
    color: #dee2e6;
    position: absolute;
    z-index: 10;
    top: 38px;
    left: 10%;
}

.btn.active {
    background-color: #919191;
}

.brokencard {
    border: none;
}

card.header {
    font-size: 1rem;
}

hr.blueline {
    border: none;
    height: 2px;
    /* Set the hr color */
    color: #314DB2; /* old IE */
    background-color: #314DB2; /* Modern Browsers */
}

.timeline-label {
    position: absolute !important;
    top: -25px !important;
    text-align: center;
    padding: 0px;
    margin: 0px;
    left: 0px;
    width: 100%;
    white-space: nowrap;
}

.btn.week.focus, .btn.week.active {
    box-shadow: none;
    outline: #919191 solid 3px;
}

.btn {
    cursor: pointer;
}


.embed-responsive-2by1::before {
    padding-top: 50%;
}

@media (max-width: 30em) {
    #format-select {
        display: none;
    }
}

.context {
    font-size: 1.2rem;
}


/*1150x wide or less */
/*@media screen and (min-width: 1150px) {
    #bottom-info {
        display: none;
    }
    #side-info {
        display: inline-block;
    }        
}
@media screen and (max-width: 1149px) {
    #side-info {
        display: none;
    }
    #bottom-info{
        display: inline-block;
    }
}*/



/* Card settings */
li p {
    color: #2B3035;
}
/* Scrollbar gone but functionality remaining */
.noscrollbar::-webkit-scrollbar {
    display: none !important;
}

.noscrollbar {
    -ms-overflow-style: none !important;
}




/* Provide sufficient contrast against white background */
.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

/* Sticky footer styles
-------------------------------------------------- */
/* html {
    margin-top: 60px;
    font-size: 14px;
} */

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.border-top {
    border-top: 1px solid #e5e5e5;
}

.border-bottom {
    border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
    font-size: 1rem;
    line-height: inherit;
}

/* Sticky footer styles-------------------------------------------------- */
html {
    position: relative;
    min-height: 100%;
}

body {
    /* Margin bottom by footer height */
    margin-bottom: 60px;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px; /* Vertically center the text there */
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<div class="container">
  <div class="row">    
    <div class=" offset-3 col-4" style="height:200px;">
        <a tabindex="0" class="btn btn-primary" data-placement="left" role="button" data-html="true" data-toggle="popover" title="Incorrect Info"
           data-content="And here's some amazing content. It's very engaging. Right?">
            Incorrect Info?
        </a>
    </div>
</div>
</div>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...