Skip to content

Accordion Menu 1


accordion menu 1



  <div class="container">
        <h2>WEB LANGUAGES</h2>
        <button class="accordion">HTML</button>
        <div id="box">
                Hypertext Markup Language is the standard text markup
                language used to create web pages. The last version of the
                language is HTML5. HTML cannot be defined as a programming language.
                Because a program that works on its own with HTML code can not be written.

        <button class="accordion">CSS</button>
        <div id="box">
                Cascading Style Sheets is a Web technology that offers additional
                possibilities for formatting text and formats in addition to HTML.

        <button class="accordion">JavaScript</button>
        <div id="box">
                JavaScript® (usually abbreviated as js) is an object-oriented programming
                language that is simply interpreted and blended with first-class functions.
                It is commonly known as a scripting language for web pages, but is often
                used in non-browser environments such as node.js or Apache CouchDB. Having
                a prototype-based and multi-paradigm language provides a dynamic and
                functional structure. Learn more about JavaScript.


    padding: 0;
    margin: 0;
    background: #fff;
.container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: auto;
    transform: translate(-50%,-50%);
    transition: .5s;
    font-family: arial;
    font-weight: bolder;
.accordion {
    text-align: left;
    outline: none;
    padding: 20px;
    width: 100%;
    border: none;
    font-family: Verdana, sans-serif;
    font-weight: bold;
    font-size: 18px;
    color: #ccc;
    background: #1a1a1a;
    box-shadow: 0px 0px 20px #262626;
    border: 2px solid #ccc;
    transition: .4s;
    padding: 5px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #262626;
    font-family: Arial;
    overflow: hidden;
    display: none;
    background: #ccc;
    color: #262626;
    transition: .5s;


 let acordion = document.getElementsByClassName("accordion");

        for (let i = 0; i < acordion.length; i++) {
            acordion[i].addEventListener("click", function () {
                let box = this.nextElementSibling;
                if ( === "none") {
           = "block";
                else {
           = "none"

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: