How do bar get responsive?

Asked

Viewed 375 times

2

inserir a descrição da imagem aqui

I’m trying to make this HTML5 video player icons responsive.

      <div id="video-controls">
            <div class="play-video">
                {!! Html::image('img/video/play.png', 'Play / Pause Video', ['class' => 'play-pause']) !!}
            </div>
            <div class="progress">
                <span class="progress-bar"></span>
            </div>
            <div class="mute-video">
                {!! Html::image('img/video/mute.png', 'Mudo', ['class' => 'mute']) !!}
            </div>
            <div class="volume">
                <span class="volume-bar"></span>
            </div>
            <div class="setting-video">
                {!! Html::image('img/video/settings.png', 'Opções', ['class' => 'settings']) !!}
            </div>
            <div class="full">
                {!! Html::image('img/video/full-screen.png', 'Tela Cheia', ['class' => 'full-screen']) !!}
            </div>
        </div>
  • CSS

        .video{
            position: relative;
            width: 100%;
            max-width: 873px;
            margin: auto;
    
            #video-controls{
                position: absolute;
                background-color: #eff2f6;
                width: 98%;
                max-width: 850px;
                margin: auto;
                left: 0;
                right: 0;
                bottom: 3px;
                line-height: 18px;
                height: 18px;
                opacity: 1;
                text-align: center;
                transition: all 0.35s ease;
                display: table-cell;
    
                div{
                    display: inline-block;
                    max-width: 100%/6;
                }
            }
       }
    

I’ve used display: table and display:table-cell, display:inline-block. But I couldn’t. The size of the video control bar is 850px. I need you to stay responsive up to that size.

I tried to use width: 100% and max-width, and nothing.

The main is everyone’s father, but doesn’t have a css interfering.

  • 2

    Can make a Fiddle?

  • I can’t make it today...

  • Want the tag div#video-controls get responsive right? Where is it? Put the HTML that surrounds it in the question.

  • She’s out there crazy.

  • But she is 100%. I need the icons to fill all the space on that bar proportionally.

  • "Where is she?" I meant her location in the code, what are her parent elements. She is the daughter of the body, or of tag video or a div? Also put the CSS of these relatives.

  • main > div.video > div#video-controls.

  • Have you tried using display: flex; ?

  • I didn’t try it because I read that this property is not yet working in all browsers. But I may have some method that makes it work. I’ll try to use.

  • But what elements do I apply this @devgaspa property to ?

  • 1

    this property works as if it were a container for your children leaving, for example, all the children of the container flexible Ivs. this article can help you (https://css-tricks.com/snippets/css/a-guide-to-flexbox/).

  • 1

    Good afternoon Deesouza, always try to post generated code, you can get this with Ctrl+U in webbrowser, if you don’t limit your help that is a problem with CSS only to those who work with the same framework (which I believe is Laravel). Good luck!

Show 7 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.