I am trying to get an H2 element filled with a "Portfolio" centered over 2 img elements. I have problems with this. Right now it is stuck on the left side of the 2.col-md-4 bootstrap columns. Could you point me in the right direction?
Here is the code .
Here is the code:
<div class="portf row"> <h2>Portfolio</h2> <div class="portfolio col-md-4"> <img class="port1 img-responsive" src="https://s8.postimg.org/v4ol85ct1/hangman.jpg"> <p>A game of hangman made with: HTML, CSS, and JavaScript.</p> </div> <div class="col-md-4 img-responsive"><img src="https://s8.postimg.org/3kagp7ctx/BFSkinner.jpg" alt="pic 2"> <p>A B.F. Skinner tribute page made with: HTML and CSS.</p> </div> </div>
Your style display:flexin the class rowcauses this. Adding the following CSS should fix the immediate problem:
display:flex
row
.portf { display: block; }
, display:flex row. CSS , col-md-8, col-md-offset-2.
col-md-8
col-md-offset-2
. col-md-6 div. , .
<div class="portf"> <h2>Portfolio</h2> <div class="portfolio col-md-6"> <img class="port1 img-responsive" src="https://s8.postimg.org/v4ol85ct1/hangman.jpg"> <p>A game of hangman made with: HTML, CSS, and JavaScript.</p> </div> <div class="col-md-6 img-responsive"> <img src="https://s8.postimg.org/3kagp7ctx/BFSkinner.jpg" alt="pic 2"> <p>A B.F. Skinner tribute page made with: HTML and CSS.</p> </div> </div>
Source: https://habr.com/ru/post/1650496/More articles:How to read PHP serialize () data in R - phpUnable to read force property undefined (simple D3 network diagram) - javascriptGetting WebDriver to work with Firefox - seleniumUIView on the playground - swiftWhy is my data not protected, even if I use "const" in C? - cHow to vertically align 2 classes inside a div - cssHow to find the appropriate .pdb inside a .NET assembly? - debuggingHow to cut slices using another slice as a separator? - rustwhy do functions return multidimensional arrays, but the result is num? - javascriptHow to create one instance for an instance in Redux? - reactjsAll Articles