I can't get a component to display as inline-block in Angular2Block-level elements within display: inline-blockHow do I remove the space between inline-block elements?how to make div width fits nested inline images within?What is the difference between display: inline and display: inline-block?CSS display: inline vs inline-blockHTML inline-block layoutCSS: Using text-align: center to centre a DIV using display: inline-blockStrange behavior on computed height and childrens margindiv with inline-block not resizingAngular2 component render to a div reference and not css selector

Why do I get two different answers for this counting problem?

NMaximize is not converging to a solution

A case of the sniffles

Client team has low performances and low technical skills: we always fix their work and now they stop collaborate with us. How to solve?

How old can references or sources in a thesis be?

What's that red-plus icon near a text?

Codimension of non-flat locus

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

Important Resources for Dark Age Civilizations?

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

Can you really stack all of this on an Opportunity Attack?

Intersection point of 2 lines defined by 2 points each

Are the number of citations and number of published articles the most important criteria for a tenure promotion?

LWC SFDX source push error TypeError: LWC1009: decl.moveTo is not a function

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?

Why doesn't H₄O²⁺ exist?

Revoked SSL certificate

How does quantile regression compare to logistic regression with the variable split at the quantile?

A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?

LaTeX: Why are digits allowed in environments, but forbidden in commands?

Horror movie about a virus at the prom; beginning and end are stylized as a cartoon

Does detail obscure or enhance action?

High voltage LED indicator 40-1000 VDC without additional power supply

Replacing matching entries in one column of a file by another column from a different file



I can't get a component to display as inline-block in Angular2


Block-level elements within display: inline-blockHow do I remove the space between inline-block elements?how to make div width fits nested inline images within?What is the difference between display: inline and display: inline-block?CSS display: inline vs inline-blockHTML inline-block layoutCSS: Using text-align: center to centre a DIV using display: inline-blockStrange behavior on computed height and childrens margindiv with inline-block not resizingAngular2 component render to a div reference and not css selector






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















In my Angular2 app, I have a parent component, which via an ngFor loop generates a number of instances of a child component - app-video-container - which is essentially a div with an iframe inside. I want these videos to display in a grid type layout. I am trying to use inline-block to accomplish this, as below, but it does not work, it just displays as a single column of videos. If I use float:left instead of inline-block, that displays the videos in a grid the way I want, but I need to able to use inline-block instead. What am I doing wrong? Why does float work but not inline-block? Here is the condensed/simplified version my code:



Parent component HTML:



<div *ngFor="let video of videos">
<app-video-container>[videoURL]=video.videoURL</app-video-container>
</div>


CSS for parent component



:host 
background-color:black;
position:relative;



App-video-container component HTML:



<div class="videoContainer">
<iframe [src]="videoURL" allowfullscreen></iframe>
</div>


App-video-container component CSS



.videoContainer 
width:20%;
height:100px;
margin-left:4%;
margin-bottom: 20px;
display:inline-block;










share|improve this question






















  • Try using display: flex instead.

    – Benjamin
    Mar 21 at 22:53

















0















In my Angular2 app, I have a parent component, which via an ngFor loop generates a number of instances of a child component - app-video-container - which is essentially a div with an iframe inside. I want these videos to display in a grid type layout. I am trying to use inline-block to accomplish this, as below, but it does not work, it just displays as a single column of videos. If I use float:left instead of inline-block, that displays the videos in a grid the way I want, but I need to able to use inline-block instead. What am I doing wrong? Why does float work but not inline-block? Here is the condensed/simplified version my code:



Parent component HTML:



<div *ngFor="let video of videos">
<app-video-container>[videoURL]=video.videoURL</app-video-container>
</div>


CSS for parent component



:host 
background-color:black;
position:relative;



App-video-container component HTML:



<div class="videoContainer">
<iframe [src]="videoURL" allowfullscreen></iframe>
</div>


App-video-container component CSS



.videoContainer 
width:20%;
height:100px;
margin-left:4%;
margin-bottom: 20px;
display:inline-block;










share|improve this question






















  • Try using display: flex instead.

    – Benjamin
    Mar 21 at 22:53













0












0








0


1






In my Angular2 app, I have a parent component, which via an ngFor loop generates a number of instances of a child component - app-video-container - which is essentially a div with an iframe inside. I want these videos to display in a grid type layout. I am trying to use inline-block to accomplish this, as below, but it does not work, it just displays as a single column of videos. If I use float:left instead of inline-block, that displays the videos in a grid the way I want, but I need to able to use inline-block instead. What am I doing wrong? Why does float work but not inline-block? Here is the condensed/simplified version my code:



Parent component HTML:



<div *ngFor="let video of videos">
<app-video-container>[videoURL]=video.videoURL</app-video-container>
</div>


CSS for parent component



:host 
background-color:black;
position:relative;



App-video-container component HTML:



<div class="videoContainer">
<iframe [src]="videoURL" allowfullscreen></iframe>
</div>


App-video-container component CSS



.videoContainer 
width:20%;
height:100px;
margin-left:4%;
margin-bottom: 20px;
display:inline-block;










share|improve this question














In my Angular2 app, I have a parent component, which via an ngFor loop generates a number of instances of a child component - app-video-container - which is essentially a div with an iframe inside. I want these videos to display in a grid type layout. I am trying to use inline-block to accomplish this, as below, but it does not work, it just displays as a single column of videos. If I use float:left instead of inline-block, that displays the videos in a grid the way I want, but I need to able to use inline-block instead. What am I doing wrong? Why does float work but not inline-block? Here is the condensed/simplified version my code:



Parent component HTML:



<div *ngFor="let video of videos">
<app-video-container>[videoURL]=video.videoURL</app-video-container>
</div>


CSS for parent component



:host 
background-color:black;
position:relative;



App-video-container component HTML:



<div class="videoContainer">
<iframe [src]="videoURL" allowfullscreen></iframe>
</div>


App-video-container component CSS



.videoContainer 
width:20%;
height:100px;
margin-left:4%;
margin-bottom: 20px;
display:inline-block;







css angular






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 21 at 22:52









namkcuRnamkcuR

303




303












  • Try using display: flex instead.

    – Benjamin
    Mar 21 at 22:53

















  • Try using display: flex instead.

    – Benjamin
    Mar 21 at 22:53
















Try using display: flex instead.

– Benjamin
Mar 21 at 22:53





Try using display: flex instead.

– Benjamin
Mar 21 at 22:53












1 Answer
1






active

oldest

votes


















0














inline-block is not working the way you are expecting it to because you have a div wrapped around each .videoContainer div.



Remove the videoContainer class from the inner div



<div>
<iframe [src]="videoURL" allowfullscreen></iframe>
</div>


and add it to the outer div



<div class="videoContainer" *ngFor="let video of videos">
<app-video-container>[videoURL]=video.videoURL</app-video-container>
</div>





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290411%2fi-cant-get-a-component-to-display-as-inline-block-in-angular2%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    inline-block is not working the way you are expecting it to because you have a div wrapped around each .videoContainer div.



    Remove the videoContainer class from the inner div



    <div>
    <iframe [src]="videoURL" allowfullscreen></iframe>
    </div>


    and add it to the outer div



    <div class="videoContainer" *ngFor="let video of videos">
    <app-video-container>[videoURL]=video.videoURL</app-video-container>
    </div>





    share|improve this answer



























      0














      inline-block is not working the way you are expecting it to because you have a div wrapped around each .videoContainer div.



      Remove the videoContainer class from the inner div



      <div>
      <iframe [src]="videoURL" allowfullscreen></iframe>
      </div>


      and add it to the outer div



      <div class="videoContainer" *ngFor="let video of videos">
      <app-video-container>[videoURL]=video.videoURL</app-video-container>
      </div>





      share|improve this answer

























        0












        0








        0







        inline-block is not working the way you are expecting it to because you have a div wrapped around each .videoContainer div.



        Remove the videoContainer class from the inner div



        <div>
        <iframe [src]="videoURL" allowfullscreen></iframe>
        </div>


        and add it to the outer div



        <div class="videoContainer" *ngFor="let video of videos">
        <app-video-container>[videoURL]=video.videoURL</app-video-container>
        </div>





        share|improve this answer













        inline-block is not working the way you are expecting it to because you have a div wrapped around each .videoContainer div.



        Remove the videoContainer class from the inner div



        <div>
        <iframe [src]="videoURL" allowfullscreen></iframe>
        </div>


        and add it to the outer div



        <div class="videoContainer" *ngFor="let video of videos">
        <app-video-container>[videoURL]=video.videoURL</app-video-container>
        </div>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 21 at 22:57









        abney317abney317

        2,34731738




        2,34731738





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290411%2fi-cant-get-a-component-to-display-as-inline-block-in-angular2%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현