enter image description here
How to make it look like the picture above?
<div class="row">
<img class="" src="/images/arrow_left_icon.png" />
<p class="">tip</p>
</div>
i would like responsive look like the picture i post
2
Answers
You can use
display: flex
property to arrange both the image and content horizontally. But you need media query for adding css in responsive for specific breakpoint.For example:-
Your question was not entirely clear regarding how you want the layout to look and the how you want it to be responsive. Given the limited information you provided, here is how I would go about it.
First, modify your HTML slightly so that you have some additional classes to work with and add the
alt
attribute to your<img>
. You probably don’t want to add specific styling for this section to the.row
class since that is likely to be used in a lot of other places as well, so add an additional class to that div.Next, I apply the img styles I use for every project for better default settings and to enhance responsiveness, and then I use grid to make the layout.
Here is the the snippet demo so you can see it working.
And here is a link to my codepen where it is demo’d as well so you can actually test what it looks like when you change the viewport size. If this is not what you are looking for, please update your question with more details.