I
I
Ik_Ing2015-07-04 13:39:51
safari
Ik_Ing, 2015-07-04 13:39:51

Why doesn't input label work in Safari?

In all browsers everything is OK, only in Safari when you click nothing happens. Who knows, please tell me how to fix it.
HTML

<div class="horizontal-click">
    <input type="checkbox" name="vkl" id="vkl1"/>
    <label for="vkl1">ONE</label>
    <div>
        <p>Text.</p>
    </div>
    <input type="checkbox" name="vkl" id="vkl2"/>
    <label for="vkl2">TWO</label>
    <div>
        <ul>
            <li>text</li>
            <li>text</li>
        </ul>
    </div>
</div>

css
.horizontal-click [name="vkl"] { display: none; }
.horizontal-click > :not(input):not(label) {
    overflow: hidden;
    height: 0;
    margin: 0;
    padding: 0 .5em;
    border: none;
    border-top-style: none;
    transition: height 0.5s ease;
    -webkit-transition: height 0.5s ease;
}
.horizontal-click > label {
    overflow: hidden;
    display: block;
    padding: .5em 1em;
    background: #ffffff;
    color: rgb(200,200,200);
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    border-top: 1px solid #eeeeee;
}
.horizontal-click > :checked + label + * {
    overflow: visible;
    height: auto;
}
.horizontal-click > :checked + label {
    background: #eeeeee;
    cursor: default;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Zhilin, 2015-07-09
@Merdue

And it works for me! Hackintosh GA-Z97MX Gaming 5 rev.1.0 GV-nGTX970IXOC 4GD MAC OS X 10.10.4 SAFARI latest update!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question