HTML tag does not work in IE/Edge
up vote
3
down vote
favorite
I am trying to add additional toggleable section that user can show and hide.
My requirements:
- supported on major browsers (Opera, Chrome, Edge, IE11, Firefox, Safari on Mac)
- no javascript
And was thinking of using the <details>
tag, however the code
<details>
<summary>Toggle</summary>
<p>Hideable</p>
</details>
does not work on the Edge / IE browsers.
Can I anyhow "make" it work, or is there anything else I can use for that task? Hacks are OK, as long as no javascript is present.
html html5 internet-explorer microsoft-edge
add a comment |
up vote
3
down vote
favorite
I am trying to add additional toggleable section that user can show and hide.
My requirements:
- supported on major browsers (Opera, Chrome, Edge, IE11, Firefox, Safari on Mac)
- no javascript
And was thinking of using the <details>
tag, however the code
<details>
<summary>Toggle</summary>
<p>Hideable</p>
</details>
does not work on the Edge / IE browsers.
Can I anyhow "make" it work, or is there anything else I can use for that task? Hacks are OK, as long as no javascript is present.
html html5 internet-explorer microsoft-edge
1
:target
or:checked
come to mind, if adding the necessary additional elements (a link for the former, or a checkbox + label for the latter) is not a problem. sitepoint.com/css3-vertical-accordion-using-target-selector, geoffgraham.me/css-only-accordion-using-the-checkbox-hack explain the basic principles behind both techniques.
– CBroe
Jul 12 at 11:17
@CBroe so cool, I wouldn't think of it. My guess is that you should publish it as an answer.
– wscourge
Jul 12 at 14:21
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I am trying to add additional toggleable section that user can show and hide.
My requirements:
- supported on major browsers (Opera, Chrome, Edge, IE11, Firefox, Safari on Mac)
- no javascript
And was thinking of using the <details>
tag, however the code
<details>
<summary>Toggle</summary>
<p>Hideable</p>
</details>
does not work on the Edge / IE browsers.
Can I anyhow "make" it work, or is there anything else I can use for that task? Hacks are OK, as long as no javascript is present.
html html5 internet-explorer microsoft-edge
I am trying to add additional toggleable section that user can show and hide.
My requirements:
- supported on major browsers (Opera, Chrome, Edge, IE11, Firefox, Safari on Mac)
- no javascript
And was thinking of using the <details>
tag, however the code
<details>
<summary>Toggle</summary>
<p>Hideable</p>
</details>
does not work on the Edge / IE browsers.
Can I anyhow "make" it work, or is there anything else I can use for that task? Hacks are OK, as long as no javascript is present.
html html5 internet-explorer microsoft-edge
html html5 internet-explorer microsoft-edge
asked Jul 12 at 11:13
Igor Mandzopulos
284
284
1
:target
or:checked
come to mind, if adding the necessary additional elements (a link for the former, or a checkbox + label for the latter) is not a problem. sitepoint.com/css3-vertical-accordion-using-target-selector, geoffgraham.me/css-only-accordion-using-the-checkbox-hack explain the basic principles behind both techniques.
– CBroe
Jul 12 at 11:17
@CBroe so cool, I wouldn't think of it. My guess is that you should publish it as an answer.
– wscourge
Jul 12 at 14:21
add a comment |
1
:target
or:checked
come to mind, if adding the necessary additional elements (a link for the former, or a checkbox + label for the latter) is not a problem. sitepoint.com/css3-vertical-accordion-using-target-selector, geoffgraham.me/css-only-accordion-using-the-checkbox-hack explain the basic principles behind both techniques.
– CBroe
Jul 12 at 11:17
@CBroe so cool, I wouldn't think of it. My guess is that you should publish it as an answer.
– wscourge
Jul 12 at 14:21
1
1
:target
or :checked
come to mind, if adding the necessary additional elements (a link for the former, or a checkbox + label for the latter) is not a problem. sitepoint.com/css3-vertical-accordion-using-target-selector, geoffgraham.me/css-only-accordion-using-the-checkbox-hack explain the basic principles behind both techniques.– CBroe
Jul 12 at 11:17
:target
or :checked
come to mind, if adding the necessary additional elements (a link for the former, or a checkbox + label for the latter) is not a problem. sitepoint.com/css3-vertical-accordion-using-target-selector, geoffgraham.me/css-only-accordion-using-the-checkbox-hack explain the basic principles behind both techniques.– CBroe
Jul 12 at 11:17
@CBroe so cool, I wouldn't think of it. My guess is that you should publish it as an answer.
– wscourge
Jul 12 at 14:21
@CBroe so cool, I wouldn't think of it. My guess is that you should publish it as an answer.
– wscourge
Jul 12 at 14:21
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
This would be the suggested :checked
method utilizing a hidden checkbox:
.toggler {
display: none;
}
.toggler+.toggler-content {
max-height: 0;
opacity: 0;
overflow: hidden;
transition: all .4s ease-in-out;
}
.toggler:checked+.toggler-content {
max-height: 1000px;
opacity: 1;
}
<div>
<label for="toggler-id-1">Toggle</label>
<input type="checkbox" id="toggler-id-1" class="toggler" />
<div class="toggler-content">Hideable</div>
</div>
I would still prefer going with @Finesse's solution because it allows you to use the semantically correct HTML element for the purpose.
add a comment |
up vote
2
down vote
You can add a polyfill once on a page to make all the <details/>
s on the page work:
<!-- Inside the body -->
<script src="//cdn.jsdelivr.net/npm/details-polyfill@1/index.min.js" async></script>
I know this is a JS solution but it doesn't require writing any JS for each individual <details/>
. It can be used with a text written in a WYSIWYG editor.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
This would be the suggested :checked
method utilizing a hidden checkbox:
.toggler {
display: none;
}
.toggler+.toggler-content {
max-height: 0;
opacity: 0;
overflow: hidden;
transition: all .4s ease-in-out;
}
.toggler:checked+.toggler-content {
max-height: 1000px;
opacity: 1;
}
<div>
<label for="toggler-id-1">Toggle</label>
<input type="checkbox" id="toggler-id-1" class="toggler" />
<div class="toggler-content">Hideable</div>
</div>
I would still prefer going with @Finesse's solution because it allows you to use the semantically correct HTML element for the purpose.
add a comment |
up vote
2
down vote
This would be the suggested :checked
method utilizing a hidden checkbox:
.toggler {
display: none;
}
.toggler+.toggler-content {
max-height: 0;
opacity: 0;
overflow: hidden;
transition: all .4s ease-in-out;
}
.toggler:checked+.toggler-content {
max-height: 1000px;
opacity: 1;
}
<div>
<label for="toggler-id-1">Toggle</label>
<input type="checkbox" id="toggler-id-1" class="toggler" />
<div class="toggler-content">Hideable</div>
</div>
I would still prefer going with @Finesse's solution because it allows you to use the semantically correct HTML element for the purpose.
add a comment |
up vote
2
down vote
up vote
2
down vote
This would be the suggested :checked
method utilizing a hidden checkbox:
.toggler {
display: none;
}
.toggler+.toggler-content {
max-height: 0;
opacity: 0;
overflow: hidden;
transition: all .4s ease-in-out;
}
.toggler:checked+.toggler-content {
max-height: 1000px;
opacity: 1;
}
<div>
<label for="toggler-id-1">Toggle</label>
<input type="checkbox" id="toggler-id-1" class="toggler" />
<div class="toggler-content">Hideable</div>
</div>
I would still prefer going with @Finesse's solution because it allows you to use the semantically correct HTML element for the purpose.
This would be the suggested :checked
method utilizing a hidden checkbox:
.toggler {
display: none;
}
.toggler+.toggler-content {
max-height: 0;
opacity: 0;
overflow: hidden;
transition: all .4s ease-in-out;
}
.toggler:checked+.toggler-content {
max-height: 1000px;
opacity: 1;
}
<div>
<label for="toggler-id-1">Toggle</label>
<input type="checkbox" id="toggler-id-1" class="toggler" />
<div class="toggler-content">Hideable</div>
</div>
I would still prefer going with @Finesse's solution because it allows you to use the semantically correct HTML element for the purpose.
.toggler {
display: none;
}
.toggler+.toggler-content {
max-height: 0;
opacity: 0;
overflow: hidden;
transition: all .4s ease-in-out;
}
.toggler:checked+.toggler-content {
max-height: 1000px;
opacity: 1;
}
<div>
<label for="toggler-id-1">Toggle</label>
<input type="checkbox" id="toggler-id-1" class="toggler" />
<div class="toggler-content">Hideable</div>
</div>
.toggler {
display: none;
}
.toggler+.toggler-content {
max-height: 0;
opacity: 0;
overflow: hidden;
transition: all .4s ease-in-out;
}
.toggler:checked+.toggler-content {
max-height: 1000px;
opacity: 1;
}
<div>
<label for="toggler-id-1">Toggle</label>
<input type="checkbox" id="toggler-id-1" class="toggler" />
<div class="toggler-content">Hideable</div>
</div>
answered Nov 2 at 7:42
connexo
19.7k73353
19.7k73353
add a comment |
add a comment |
up vote
2
down vote
You can add a polyfill once on a page to make all the <details/>
s on the page work:
<!-- Inside the body -->
<script src="//cdn.jsdelivr.net/npm/details-polyfill@1/index.min.js" async></script>
I know this is a JS solution but it doesn't require writing any JS for each individual <details/>
. It can be used with a text written in a WYSIWYG editor.
add a comment |
up vote
2
down vote
You can add a polyfill once on a page to make all the <details/>
s on the page work:
<!-- Inside the body -->
<script src="//cdn.jsdelivr.net/npm/details-polyfill@1/index.min.js" async></script>
I know this is a JS solution but it doesn't require writing any JS for each individual <details/>
. It can be used with a text written in a WYSIWYG editor.
add a comment |
up vote
2
down vote
up vote
2
down vote
You can add a polyfill once on a page to make all the <details/>
s on the page work:
<!-- Inside the body -->
<script src="//cdn.jsdelivr.net/npm/details-polyfill@1/index.min.js" async></script>
I know this is a JS solution but it doesn't require writing any JS for each individual <details/>
. It can be used with a text written in a WYSIWYG editor.
You can add a polyfill once on a page to make all the <details/>
s on the page work:
<!-- Inside the body -->
<script src="//cdn.jsdelivr.net/npm/details-polyfill@1/index.min.js" async></script>
I know this is a JS solution but it doesn't require writing any JS for each individual <details/>
. It can be used with a text written in a WYSIWYG editor.
edited Nov 10 at 8:43
answered Nov 2 at 6:52
Finesse
1,98031331
1,98031331
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51304178%2fhtml-details-tag-does-not-work-in-ie-edge%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
:target
or:checked
come to mind, if adding the necessary additional elements (a link for the former, or a checkbox + label for the latter) is not a problem. sitepoint.com/css3-vertical-accordion-using-target-selector, geoffgraham.me/css-only-accordion-using-the-checkbox-hack explain the basic principles behind both techniques.– CBroe
Jul 12 at 11:17
@CBroe so cool, I wouldn't think of it. My guess is that you should publish it as an answer.
– wscourge
Jul 12 at 14:21