Im trying to do up a portfolio but I cant seem to rid off the spaces in between my logo images.
The images are very spaced out and I cant seem to find the method on how to compact my images with a padding of 5px between each image
<html>
<head>
<title>Welcome to my portfolio! </title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-
awesome.min.css">
<script>
.logos {
position: absolute;
top: 40%;
display: flex;}
.img-container {
float:left;
width: 35%;}
</script>
</head>
<body>
<p>Find me on my socials!</p></p></div>
<div class="logos">
<div class="img-container">
<img src="facebook logo.png" width="100%">
</div>
<div class="img-container">
<img src="instagram logo.png" width="100%">
</div>
<div class="img-container">
<img src="linkedin logo.png" width="100%">
</div>
</div>
</div>
</body>
</html>
I am not sure if it is due to the way i saved my images, but this is done on photoshop
[1]: https://i.stack.imgur.com/FtVLC.png
3
Answers
I have fixed noticed errors in your code. There were some HTML code issues in your code snippet & also no need to
float:left
when the parent isflex
.https://codesandbox.io/s/big-white-spaces-67981326-8wdoj?file=/index.html
Let me know if you need further support.
Please try these lines of code.
Please find the below snippet. If you remove the padding given to .img-container in this snippets, there will not be any space between the logos. You can update the space required.
Currently I have given 100% width to my images, you can change it and give a static width as well.