I am working on a layout where I have some text on the left side and an image on the right side. Below them, I have three smaller images. I want to align the left text and the right image so that they both vertically align with the bottom images.
Here is my current layout:
As you can see in the image:
• The text on the left is higher than the bottom images.
• The large image on the right is also higher than the bottom images.
What I want to achieve:
• I want the text on the left to be vertically aligned with the bottom images.
• I also want the large image on the right to be vertically aligned with the bottom images.
• The gap between the text and the image should be exactly 160px.
I’ve tried adjusting the margins and padding, but I haven’t been able to get the alignment correct. What would be the best approach in CSS to achieve this alignment?
I’ve created a Fiddle to demonstrate the issue: https://jsfiddle.net/fptL74bx/
I think the necessary adjustments need to be made in the following section of the CSS code in fiddle.
.intro {
display: flex;
padding-top: 160px;
justify-content: center;
2
Answers
i add this line to css in your jsfillde
and also removed p height.
You can try this to make the text move left and the image move right:
And to add space between the text and image you can use the
gap
propertyYour code should look like this
I hope this solution addresses your issue. If not, please feel free to provide more details or clarify your question further.