I’m currently on the Portfolio challenge, which is one of the firsts and barely have I started that I’m already encountering a road-block.
I read documentation on bootstrap and CSS, but I haven’t exactly got what I am looking for. Now, my searches don’t seem to be bringing up promising solutions. And while I cannot be sure, I have the feeling the solution to my problem will be rather simple. I’m probably just missing a little something, somewhere.
So, I have to structure my portfolio challenge on the one freecodecamp made here.
The problem lies with the image. It keeps overflowing vertically into the body. It doesn’t stay in the col-4 column. I tried putting a container box titled portrait, but it doesn’t change a single thing.
Not sure how to move forward on this one, the image is not resizing properly to occupy -only- the space allotted to that pic. I also need to make it round. round-border and img-fluid Bootstrap 4’s classes don’t seem to be giving me the result I’m looking for.
Apparently, the img.responsive class became img-fluid in Bootstrap 4, but they’re supposed to act the same. That’s an information provided first on Stack Overflow, but then I went on Bootstrap’s 4 documentation, in the image section, and it confirmed it.
Here’s a link to my CodePen, although I absolutely dislike that tool. For this purpose I can see its relevance.
In codepen, you can go to settings -> css and click the little eye symbol next to bootstrap to see the code (for bootstrap) in a new tab. Then search for img-fluid and you’ll see the rules it’s applying.
This solves the problem of having the image fit the container box. I’m wondering though, I thought making the image’s shape a circle was as simple as applying the style border-radius: 50%;, but this results in an oval instead of a round circle. Would you happen to know what’s causing that? I even tried using Bootstrap’s .rounded-circle class, instead of the border-radius: 50%; style, but it gives the same result. Is it because of the images specs? Or the height of my container box, which is defined?
Border radius 50% will turn a square image into a circle or a rectangular image into an oval. Think of taking a piece of paper. You make a mark halfway along every side. Now draw a curve on each corner connecting those marks. The length and width are going to stay the same. Only the corners will change.
This is why when you upload a profile picture to something like facebook, it makes you select a square region before it creates the circle.