I am having a flex container with an image and a text. The image is in a <div>
and the text is within a <ul> and <li>
elements. The <li>
is another flex container to justify the text in the center. However, there is a space between the <li>
container and the child <div>
of the first container. Is there a way to remove the space and center it vertically? I used margin-left:-4%;
to remove the space. Is it the right approach?
Currently this is how it looks:
Removing the space and vertically center aligned this is how i want it to look-
CSS:
.headlineContainer{
display:flex;
border: red 2px solid;
justify-content: flex-start;
}
#myPhoto{
width:10%;
border: blue 2px solid;
}
#myPhoto>img{
width: 100%;
}
#myHeadline{
border: green 2px solid;
list-style-type: none;
margin-left:-2%;
}
#myHeadline li{
display: flex;
border: 2px solid gray;
justify-content: center;
}
#myHeadline #name{
color: #008080;
font-size: 340%;
font-weight: 300;
font-style:normal;
}
#myHeadline #Tagline{
font-size: 150%;
color:#000000;
}