Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

html - How to create a multi-level responsive menu?

I want to make a fully responsive menu with various options. I want to do something similar to the following. But I want the buttons to not have a fixed size, nor a fixed number of columns, and that all the buttons always have the same size, and of course that the buttons cover the entire size of the box. I was trying to do it with the flex property, but it didn't work for me. I show you the menu.

Thank you very much.

I want something like this

https://i.stack.imgur.com/Yj0Nf.png

But this happens to me

https://i.stack.imgur.com/dOAq8.png

CSS

    #desplegableTitle {
        width: 160px;
        margin-left: auto;
        margin-right: auto;
    }
    
    #desplegableTitle a {
        background-color: #00857a;
        color: #fff;
        box-shadow: #aaaaaa 0px 0px 15px 0px;
        border-radius: 20px;
        padding: 8px;
    }
    
    .listaRecursos {
        padding: 20px;
        border-radius: 20px;
        box-shadow: #cccccc 0px 0px 15px 0px;
    }
    
    #desplegable {
        overflow: hidden;
        margin-top: 20px;
        display: flex;
        flex-wrap: wrap;
    }
    
    #desplegable li {
        flex: 1 1 0px;
    }

Html

        <ul class="listaRecursos">
            <li id="desplegableTitle"><a>Recursos</a></li>
            <div id="desplegable">
                <li>
                    <a href="#">Cursos</a>
                </li>
                <li>
                    <a href="#">Videos</a>
                </li>
                <li>
                    <a href="#">Webinars</a>
                </li>
                <li>
                    <a href="#">Revistas</a>
                </li>
                <li>
                    <a href="#">Articulos</a>
                </li>
                <li>
                    <a href="#">Noticias</a>
                </li>
                <li>
                    <a href="#">Grabaciones</a>
                </li>
                <li>
                    <a href="#">12
                        Octubre</a>
                </li>
            </div>
        </ul>
    </div>
</div>
question from:https://stackoverflow.com/questions/66060639/how-to-create-a-multi-level-responsive-menu

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...