Collapsible content in blogger posts through HTML and CSS is very easy work. Just like programmers, bloggers right content on their block posts with some usage of HTML and CSS. Today I am going to show you how we can use collapsible content in blogger posts using HTML, CSS, and JavaScript.
What is collapsible content in websites and bloggers?
Collapsible content is also known as Accordion is the content structure. They used to show and height large amounts of content or block post. Accordion or collapsible content is very useful in different manners. They can be used to create Q/A, show a large amount of content or articles parts and they can be used for the table of content structure creation.
Along with these useful benefits, it is useful to clearly define each part of the article or content in different portions. With the help of collapsible content, users can get clear information from long and complicated articles.
How we can add collapsible content or Accordion in the blog post?
To add collapsible content or Accordion in the blog post you need Accordion with CSS and JavaScript. If you are a programmer then you can do this work very easily. But if you are a blogger then it will be very difficult.
For this reason, you don't need to write code.W3schools is one of the best websites to learn HTML and CSS. W3schools is one of the best websites for beginners. Here you can find every example with details. You can understand these examples with live tests and trials.
You need to do something in follow these steps.
- Open the W3Schools website.
- Once you open W3Schools enter Collapsible/Accordion in the search bar and click search.
- You will find the first website which will tell you how to use Collapsible/Accordion in HTML and CSS.
- In this website link you will find out different kinds of examples with the trial test.
- Open any try test by clicking on the try it yourself button in the example.
- After clicking try it yourself a button and another website link will be opened with the live test of collapsible content.
- Now the amazing thing is you can use this code directly in your blog post blogger.
The next step is to use the Collapsible/Accordion w3Schools example in the blogger blogpost
- Open your blogger post where you want to use collapsible content
- Now open your blogger post editor into HTML view from the left side.
- Now you have to use Accordion w3Schools code into this HTML Editor
- First you have to copy the style code from the style open and close tags. And then put it into the editor.
- After this you have to add accordion div tags from open to end div tag structure.
- The last thing is javaScript now you have to copy javascript code from the W3Schools page with the opening <script> tag and copy at the end of </script>
- You can use these 3 codes in any hierarchy such as paste style code first, then JavaScript code second and at the end, you can use a collapsible content div structure.
- Now save the blog post and take a look at your blog after publishing. You can see and test the collapsible content structure after publishing. Because if you draught your block post you will not be able to use and see collapsible content. It will simply disable draft preview in blogger posts.
0 Comments