How to fix images overlapping bootstrapHow do JavaScript closures work?How to horizontally center a <div>?How do I check if an element is hidden in jQuery?How do I remove a property from a JavaScript object?How do I redirect to another webpage?How to disable text selection highlighting?How do I include a JavaScript file in another JavaScript file?How to check whether a string contains a substring in JavaScript?How to decide when to use Node.js?How do I remove a particular element from an array in JavaScript?

How do you glue a text to a point?

Has anyone in space seen or photographed a simple laser pointer from Earth?

How many hours would it take to watch all of Doctor Who?

What steps should I take to lawfully visit the United States as a tourist immediately after visiting on a B-1 visa?

Storming Area 51

Do I have a right to cancel a purchase of foreign currency in the UK?

Why do people keep referring to Leia as Princess Leia, even after the destruction of Alderaan?

How can I get a player to accept that they should stop trying to pull stunts without thinking them through first?

Print the last, middle and first character of your code

US Civil War story: man hanged from a bridge

Is there a way to know which symbolic expression mathematica used

Why was hardware diversification an asset for the IBM PC ecosystem?

Why weren't bootable game disks ever common on the IBM PC?

If your plane is out-of-control, why does military training instruct releasing the joystick to neutralize controls?

Managing and organizing the massively increased number of classes after switching to SOLID?

Are randomly-generated passwords starting with "a" less secure?

Do you know your 'KVZ's?

How to ask for a LinkedIn endorsement?

How to properly say "bail on somebody" in German?

Is the genetic term "polycistronic" still used in modern biology?

Are neural networks prone to catastrophic forgetting?

Constructive proof of existence of free algebras for infinitary equational theories

Credit score and financing new car

Using Newton's shell theorem to accelerate a spaceship



How to fix images overlapping bootstrap


How do JavaScript closures work?How to horizontally center a <div>?How do I check if an element is hidden in jQuery?How do I remove a property from a JavaScript object?How do I redirect to another webpage?How to disable text selection highlighting?How do I include a JavaScript file in another JavaScript file?How to check whether a string contains a substring in JavaScript?How to decide when to use Node.js?How do I remove a particular element from an array in JavaScript?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I have written a node.js code to display 3 images and I am using bootstrap to style these images next to each other but the are overlapping when I use col-mid-"any number".



<% include partials/header %>
<div class="container">
<header class="jumbotron">
<div class="container">
<h1>Welcome to our locations</h1>
<p>View our Camp grounds</p>
<p>
<a class="btn btn-primary btn-large" href="/">Home</a>
<a class="btn btn-primary brn-large" href="/campgrounds/new">Add a new CampGround</a>
</p>
</div>
</header>


<div class="row text-center" style="display:flex; flex-wrap:wrap;">
<% campgrounds.forEach(function(campground) %>
<div class="col-md-3">
<div class="img-thumbnail img-fluid">
<img src="<%= campground.image %>">
<div class="caption">
<h4><%= campground.name %></h4>
</div>
</div>
</div>
<% ) %>
</div>













share|improve this question
























  • Post the CSS please.

    – Raymond
    Mar 26 at 1:34


















3















I have written a node.js code to display 3 images and I am using bootstrap to style these images next to each other but the are overlapping when I use col-mid-"any number".



<% include partials/header %>
<div class="container">
<header class="jumbotron">
<div class="container">
<h1>Welcome to our locations</h1>
<p>View our Camp grounds</p>
<p>
<a class="btn btn-primary btn-large" href="/">Home</a>
<a class="btn btn-primary brn-large" href="/campgrounds/new">Add a new CampGround</a>
</p>
</div>
</header>


<div class="row text-center" style="display:flex; flex-wrap:wrap;">
<% campgrounds.forEach(function(campground) %>
<div class="col-md-3">
<div class="img-thumbnail img-fluid">
<img src="<%= campground.image %>">
<div class="caption">
<h4><%= campground.name %></h4>
</div>
</div>
</div>
<% ) %>
</div>













share|improve this question
























  • Post the CSS please.

    – Raymond
    Mar 26 at 1:34














3












3








3








I have written a node.js code to display 3 images and I am using bootstrap to style these images next to each other but the are overlapping when I use col-mid-"any number".



<% include partials/header %>
<div class="container">
<header class="jumbotron">
<div class="container">
<h1>Welcome to our locations</h1>
<p>View our Camp grounds</p>
<p>
<a class="btn btn-primary btn-large" href="/">Home</a>
<a class="btn btn-primary brn-large" href="/campgrounds/new">Add a new CampGround</a>
</p>
</div>
</header>


<div class="row text-center" style="display:flex; flex-wrap:wrap;">
<% campgrounds.forEach(function(campground) %>
<div class="col-md-3">
<div class="img-thumbnail img-fluid">
<img src="<%= campground.image %>">
<div class="caption">
<h4><%= campground.name %></h4>
</div>
</div>
</div>
<% ) %>
</div>













share|improve this question
















I have written a node.js code to display 3 images and I am using bootstrap to style these images next to each other but the are overlapping when I use col-mid-"any number".



<% include partials/header %>
<div class="container">
<header class="jumbotron">
<div class="container">
<h1>Welcome to our locations</h1>
<p>View our Camp grounds</p>
<p>
<a class="btn btn-primary btn-large" href="/">Home</a>
<a class="btn btn-primary brn-large" href="/campgrounds/new">Add a new CampGround</a>
</p>
</div>
</header>


<div class="row text-center" style="display:flex; flex-wrap:wrap;">
<% campgrounds.forEach(function(campground) %>
<div class="col-md-3">
<div class="img-thumbnail img-fluid">
<img src="<%= campground.image %>">
<div class="caption">
<h4><%= campground.name %></h4>
</div>
</div>
</div>
<% ) %>
</div>










javascript css node.js twitter-bootstrap web-applications






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 1:35









Shiladitya

9,6399 gold badges20 silver badges31 bronze badges




9,6399 gold badges20 silver badges31 bronze badges










asked Mar 26 at 1:30









Tarek RoukozTarek Roukoz

164 bronze badges




164 bronze badges












  • Post the CSS please.

    – Raymond
    Mar 26 at 1:34


















  • Post the CSS please.

    – Raymond
    Mar 26 at 1:34

















Post the CSS please.

– Raymond
Mar 26 at 1:34






Post the CSS please.

– Raymond
Mar 26 at 1:34













1 Answer
1






active

oldest

votes


















0














Try setting the img-fluid css class on the img element itself rather than it's parent element.



<img class="img-fluid" src="<%= campground.image %>">


You were restricting the width of the image's parent element rather than the width of the image itself.



<div class="row text-center" style="display:flex; flex-wrap:wrap;">
<% campgrounds.forEach(function(campground) %>
<div class="col-md-3">
<div class="img-thumbnail">
<img class="img-fluid" src="<%= campground.image %>">
<div class="caption">
<h4><%= campground.name %></h4>
</div>
</div>
</div>
<% ) %>
</div>


Here's a CodePen as an example: https://codepen.io/anon/pen/QoPNdb



Alternatively, you could set a broad css style like this if you just want to restrict all images inside bootstrap grids to fit within their containers.



.container > .row img,
.container-fluid > .row img max-width: 100%;





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%2f55348627%2fhow-to-fix-images-overlapping-bootstrap%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














    Try setting the img-fluid css class on the img element itself rather than it's parent element.



    <img class="img-fluid" src="<%= campground.image %>">


    You were restricting the width of the image's parent element rather than the width of the image itself.



    <div class="row text-center" style="display:flex; flex-wrap:wrap;">
    <% campgrounds.forEach(function(campground) %>
    <div class="col-md-3">
    <div class="img-thumbnail">
    <img class="img-fluid" src="<%= campground.image %>">
    <div class="caption">
    <h4><%= campground.name %></h4>
    </div>
    </div>
    </div>
    <% ) %>
    </div>


    Here's a CodePen as an example: https://codepen.io/anon/pen/QoPNdb



    Alternatively, you could set a broad css style like this if you just want to restrict all images inside bootstrap grids to fit within their containers.



    .container > .row img,
    .container-fluid > .row img max-width: 100%;





    share|improve this answer





























      0














      Try setting the img-fluid css class on the img element itself rather than it's parent element.



      <img class="img-fluid" src="<%= campground.image %>">


      You were restricting the width of the image's parent element rather than the width of the image itself.



      <div class="row text-center" style="display:flex; flex-wrap:wrap;">
      <% campgrounds.forEach(function(campground) %>
      <div class="col-md-3">
      <div class="img-thumbnail">
      <img class="img-fluid" src="<%= campground.image %>">
      <div class="caption">
      <h4><%= campground.name %></h4>
      </div>
      </div>
      </div>
      <% ) %>
      </div>


      Here's a CodePen as an example: https://codepen.io/anon/pen/QoPNdb



      Alternatively, you could set a broad css style like this if you just want to restrict all images inside bootstrap grids to fit within their containers.



      .container > .row img,
      .container-fluid > .row img max-width: 100%;





      share|improve this answer



























        0












        0








        0







        Try setting the img-fluid css class on the img element itself rather than it's parent element.



        <img class="img-fluid" src="<%= campground.image %>">


        You were restricting the width of the image's parent element rather than the width of the image itself.



        <div class="row text-center" style="display:flex; flex-wrap:wrap;">
        <% campgrounds.forEach(function(campground) %>
        <div class="col-md-3">
        <div class="img-thumbnail">
        <img class="img-fluid" src="<%= campground.image %>">
        <div class="caption">
        <h4><%= campground.name %></h4>
        </div>
        </div>
        </div>
        <% ) %>
        </div>


        Here's a CodePen as an example: https://codepen.io/anon/pen/QoPNdb



        Alternatively, you could set a broad css style like this if you just want to restrict all images inside bootstrap grids to fit within their containers.



        .container > .row img,
        .container-fluid > .row img max-width: 100%;





        share|improve this answer















        Try setting the img-fluid css class on the img element itself rather than it's parent element.



        <img class="img-fluid" src="<%= campground.image %>">


        You were restricting the width of the image's parent element rather than the width of the image itself.



        <div class="row text-center" style="display:flex; flex-wrap:wrap;">
        <% campgrounds.forEach(function(campground) %>
        <div class="col-md-3">
        <div class="img-thumbnail">
        <img class="img-fluid" src="<%= campground.image %>">
        <div class="caption">
        <h4><%= campground.name %></h4>
        </div>
        </div>
        </div>
        <% ) %>
        </div>


        Here's a CodePen as an example: https://codepen.io/anon/pen/QoPNdb



        Alternatively, you could set a broad css style like this if you just want to restrict all images inside bootstrap grids to fit within their containers.



        .container > .row img,
        .container-fluid > .row img max-width: 100%;






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 26 at 2:00

























        answered Mar 26 at 1:55









        TxRegexTxRegex

        1,79014 silver badges17 bronze badges




        1,79014 silver badges17 bronze badges


















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            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%2f55348627%2fhow-to-fix-images-overlapping-bootstrap%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

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript