How do i get the image and text to align to one side while having space between the image and text while having the text align at the center of the image? Cause at time goes on, i plan on having another list but with buttons to be aligned on the same line as the text.
It would be best to post the full code to have a better understanding. However, I do notice that in your code, there isn’t a flex-direction property being defined (row or column). Whether this may help is yet to be known.
I think that a two column grid would be easier for what you want here. If you want to stick with flexbox try to put the logos and the names into two
Separate divs that both use flex. See code below but use start end on top.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
.row {
display: flex;
}
/* Create two equal columns that sits next to each other */
.column {
flex: 50%;
padding: 10px;
height: 300px; /* Should be removed. Only for demonstration */
}
</style>
</head>
<body>
<h2>Two Equal Columns</h2>
<div class="row">
<div class="column" style="background-color:#aaa;">
<h2>Column 1</h2>
<p>Some text..</p>
</div>
<div class="column" style="background-color:#bbb;">
<h2>Column 2</h2>
<p>Some text..</p>
</div>
</div>
</body>
</html>
Try flex: 0 0 xxxpx; in the left column div to servitude to xxxpx width.
If you just want the logos to the right try align-items : flex-end or justify-content : flex-end. Whichever helps
i have no idea. Maybe cause the div or container the image and text are in has no specific width but a width that resizes according to content? Please help. Thank you.
Best guess is your left column(image) also has the width of 50%. So it is taking of 50% of the row automatically. Padding doesn’t work because your text is already left justified and the padding right is not squeezing your text anywhere.
Your browser’s dev tool does a perfectly good job of giving you all the dimensions of your elements, including padding and margins. Do make use of it when you run into issues such as this. A lot of times it gives you far more information that will help you resolve the problem then us guess blindly without seeing your source code.