I am working on customizing a CSS box for a navigation menu. Here is the current CSS code:
.navigation-div
{
text-align:right;
margin-top:14px;
box-shadow:0px 0px 10px rgba(0,0,0,0.47);
padding: 0;
color:#E3E3E3;
background-color: #333;
}
Inside this box, there is an image and some text that needs styling:
#mailtext
{
margin-top:-10px;
display:inline-block;
font-size:20px;
color:white;
font-style:italic;
}
#mailpicture
{
display:inline-block;
margin-top:16px;
}
Here is the HTML structure I am using for this navigation menu:
<div class="navigation-div">
<nav class="navigation">
<h1 id="mailtext">Mail Us</h1>
<a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3950575f56795c54585055175a5654">[email protected]</a>"><img id="mailpicture" src="images/gmail.png"></a>
</nav>
</div>
Currently, I am facing an issue where the text inside #mailtext does not move upwards as intended, despite setting margin-top:-10px. This question is similar to my previous one (link provided), but now it involves the positioning of the text within the navigation menu.
I would like to find a way to align the text with the center of the image on the same line without moving it above the image. The overall goal is to improve the alignment while keeping all elements in place and avoiding the use of margin-left.
If anyone has suggestions on how to achieve this, I would greatly appreciate the help!