It is necessary to specify a specific width
and height
for the <a>
element, wrap the text inside another container that can be rotated and translated downward.
To eliminate any space between inline-block elements, you can set font-size:0;
in the #menu CSS rule. By setting font-size: <a>
, the white-space within the HTML code will effectively disappear.
See Demo here
#menu > a {
overflow:visible;
margin-top:0px;
font-size: 14px;
width:40px;
padding: 0 0 0 0;
text-decoration: none;
text-align: center;
vertical-align: middle;
display: inline-block;
font-family: Tahoma, Geneva, sans-serif;
}
#menu>a>span, #menu>a {
height:60px;
line-height:60px;
min-width:60px;
}
#menu>a>span {
float:left;
padding:0 5px;
margin-right:-5em;/* remove this if you do not want see span overflow; */
box-shadow:inset 0 0 0 1px black;
transform: rotate(-90deg) translatex(-60px);
transform-origin: top left;
background: rgba(153, 153, 153, .8);
color: rgba(255, 255, 255, 1);
}
The links should be structured like this
<a href="#"><span>Item</span></a>
.