Флажок не отображается - PullRequest
0 голосов
/ 26 февраля 2019

У меня есть флажок, который не отображается правильно в MS Edge.Я пробовал с метатегами.

Мой флажок выглядит в Edge следующим образом:

enter image description here

и так в Chrome и Mozzila:

enter image description here

В конце концов, я действительно не знаю, что я могу сделать.

HTML (Razor):

@Html.CheckBoxFor(model => model.IsPublic, new { @class = "flipswitch" })

Мой css:

    .flipswitch {
    position: relative;
    background: white;
    width: 120px;
    height: 40px;
    -webkit-appearance: initial;
    border-radius: 3px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    outline: none;
    font-size: 14px;
    font-family: Trebuchet, Arial, sans-serif;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #ddd;
}

    .flipswitch:after {
        position: absolute;
        top: 5%;
        display: block;
        line-height: 32px;
        width: 45%;
        height: 90%;
        background: #b11217;
        box-sizing: border-box;
        text-align: center;
        transition: all 0.3s ease-in 0s;
        color: white;
        border: #888 1px solid;
        border-radius: 3px;
    }

    .flipswitch:after {
        left: 2%;
        content: "OFF";
    }

    .flipswitch:checked:after {
        left: 53%;
        content: "ON";
    }

1 Ответ

0 голосов
/ 26 февраля 2019

Вы можете попробовать добавить 'display: block' в класс '.flipswitch'?

Я имею в виду:

.flipswitch {
    display: block;
    position: relative;
    background: white;
    width: 120px;
    height: 40px;
    -webkit-appearance: initial;
    border-radius: 3px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    outline: none;
    font-size: 14px;
    font-family: Trebuchet, Arial, sans-serif;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #ddd;
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...