Jump to content

Recommended Posts

Dear all:
Below is how we can collapse and uncollapse a block of text suitable for FAQ or other similar effects, using HTML5. It seems it is supported by Chrome so far. The browser, however, will automatically highlight the output of the <summary> tag with a box. Is there a way of removing such box? Thanks.
<!DOCTYPE html>
<html>
<body>
<article class="collapsible_faq">
<details>
<summary>Why do You Operate this Type of Business?</summary>
<p>This is a feature of collapsing and uncollapsing a block of text using HTML5. It is just
supported by chrome so far and Safari has started working on it. You should click on
the little arrow to the left to collapse and uncollapse the text.
</p>
</details>
<details>
<summary>In Which Countries Do You Presently Work?</summary>
<p>This is a feature of collapsing and uncollapsing a block of text using HTML5. It is just
supported by chrome so far and Safari has starting working on it. You should click on
the little arraow to the left to collapse and uncolapse the text.
</p>
</details>
</article>
</body>
</html>

Share this post


Link to post
Share on other sites

In what way is it being highlighted? Depending on what it is, you can use background-color, border or outline to override the default style.

Share this post


Link to post
Share on other sites

It draws a box around it, which I am unable to remove even by the CSS effects you mentioned. You may please use the same code I provided in chrome to see what box I am talking about.

Share this post


Link to post
Share on other sites

Some browsers add outlines:

 

 

<!DOCTYPE html>

<html>
<head>
<style>
.no-outline:focus {
outline: none;
}
</style>
<body>
<article class="collapsible_faq">
<details>
<summary class="no-outline">Why do You Operate this Type of Business?</summary>
<p>This is a feature of collapsing and uncollapsing a block of text using HTML5. It is just
supported by chrome so far and Safari has started working on it. You should click on
the little arrow to the left to collapse and uncollapse the text.
</p>
</details>
<details>
<summary class="no-outline">In Which Countries Do You Presently Work?</summary>
<p>This is a feature of collapsing and uncollapsing a block of text using HTML5. It is just
supported by chrome so far and Safari has starting working on it. You should click on
the little arraow to the left to collapse and uncolapse the text.
</p>
</details>
</article>
</body>

</html>

 

 

Hope it helps :D

Edited by DarkxPunk

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...