html - Match text height with image height in menu -
i have menu, put @ end 3 images, measuring 30x30 px each. after images being inserted, appeared space between bottom line of menu , text. image there no space between bottom of menu , images. do, have text having exact size (i managed fix space increasing font size, not solution me) , rid of space. again, space below text , not images. *check full-screen menu.
#nav { background-color: #e26a63; padding: 0; margin: 0; font-family: font; font-size: 20px; } #wrap { padding-left: 60px; height: 100px; width: 100%; margin: 0 auto; display: table-cell; vertical-align: bottom; } #nav ul { list-style-type: none; padding: 0; margin: 0; position: relative; min-width: 245px; } #nav ul li { display: inline-block; } #nav ul li:hover { background-color: #cb5f59; } #nav ul li:after { content: ""; font-size: 0; display: block; height: 5px; } #nav ul li:hover:after { background: #9e4a45; } #nav ul ul li:hover:after { background: transparent; } #nav ul li a, visited { color: white; display: block; padding: 15px; text-decoration: none; } #nav ul li:hover ul { display: block; } #nav ul ul { display: none; position: absolute; background-color: #e26a63; border-top: 0; margin-top: 5px; z-index: 100; } #nav ul ul li { display: block; } #nav ul ul li a:hover { color: white; } #nav { display: table; width: 100%; } .alignright { float: right; }
<div id="nav"> <div id="wrap"> <ul> <li><a href="home.html">home</a></li><li> <a href="#">study</a> <ul> <li><a href="present.html">present simple</a></li><li> <a href="possessives.html">possesives</a></li><li> <a href="articles.html">articles</a></li><li> <a href="modal.html">modal verbs</a></li><li> <a href="prepositions.html">prepositions</a></li><li> <a href="plural.html">plural of nouns</a></li><li> <a href="countability.html">countability</a></li> </ul> </li><li> <a href="#">games</a> <ul> <li><a href="#">riddles</a></li><li> <a href="#">flip card game</a></li><li> <a href="#">spot mistake</a></li><li> <a href="#">multiple choice</a></li> </ul> </li><li> <a href="oferta.html">shop</a></li><li> <a href="contact.html">contact</a></li><li> <a href="about.html">about us</a></li> <li style="float:right"><a><img src="gmail.png" height="30px" width="30px"></a></li> <li style="float:right"><a><img src="twitter.png" height="30px" width="30px"></a></li><li style="float:right"><a><img src="facebook.png" height="30px" width="30px"></a></li> </ul> </div> </div>
the simplest set same height texts have on images
#nav ul li a, visited { color: white; display: block; padding: 15px; height: 30px; /* added */ text-decoration: none; }
stack snippet
#nav { background-color: #e26a63; padding: 0; margin: 0; font-family: font; font-size: 20px; } #wrap { padding-left: 60px; height: 100px; width: 100%; margin: 0 auto; display: table-cell; vertical-align: bottom; } #nav ul { list-style-type: none; padding: 0; margin: 0; position: relative; min-width: 245px; } #nav ul li { display: inline-block; } #nav ul li:hover { background-color: #cb5f59; } #nav ul li:after { content: ""; font-size: 0; display: block; height: 5px; } #nav ul li:hover:after { background: #9e4a45; } #nav ul ul li:hover:after { background: transparent; } #nav ul li a, visited { color: white; display: block; padding: 15px; height: 30px; /* added */ text-decoration: none; } #nav ul li:hover ul { display: block; } #nav ul ul { display: none; position: absolute; background-color: #e26a63; border-top: 0; margin-top: 5px; z-index: 100; } #nav ul ul li { display: block; } #nav ul ul li a:hover { color: white; } #nav { display: table; width: 100%; } .alignright { float: right; }
<div id="nav"> <div id="wrap"> <ul> <li><a href="home.html">home</a></li><li> <a href="#">study</a> <ul> <li><a href="present.html">present simple</a></li><li> <a href="possessives.html">possesives</a></li><li> <a href="articles.html">articles</a></li><li> <a href="modal.html">modal verbs</a></li><li> <a href="prepositions.html">prepositions</a></li><li> <a href="plural.html">plural of nouns</a></li><li> <a href="countability.html">countability</a></li> </ul> </li><li> <a href="#">games</a> <ul> <li><a href="#">riddles</a></li><li> <a href="#">flip card game</a></li><li> <a href="#">spot mistake</a></li><li> <a href="#">multiple choice</a></li> </ul> </li><li> <a href="oferta.html">shop</a></li><li> <a href="contact.html">contact</a></li><li> <a href="about.html">about us</a></li> <li style="float:right"><a><img src="gmail.png" height="30px" width="30px"></a></li> <li style="float:right"><a><img src="twitter.png" height="30px" width="30px"></a></li><li style="float:right"><a><img src="facebook.png" height="30px" width="30px"></a></li> </ul> </div> </div>
Comments
Post a Comment