I am trying to style a navigation bar using the following CSS code:
#nav {}
#nav a {
position: relative;
display: inline-block;
color: #F0F0F0;
width: 1em;
height: 2em;
line-height: 0.9em;
}
#nav a.icon:before { padding-right: 0;}
<nav id="nav">
<a href="#me" class="fa fa-home active"><span>Home</span></a>
</nav>
However, I am facing an issue where if the text inside the navigation bar exceeds 10 characters, it automatically creates a new paragraph, causing the text to go out of the original box. How can I fix this problem?
Edit
I would like the background box in the screenshot to expand its width as the text gets longer.