css - Collapseable Text Menu -
i'm making website web dev class, , had idea make nav single letters representing menu items, when hover on letter, expand full word(s).
example: if menu item shown "[a]", when hover on letter, expands "[about]".
is can done in html5/css, or need javascript, jquery, etc?
you can achieve effect css. code can optimized lot it's give rough idea of how desired effect like.
html
<nav> <a href="">about</a> <a href="">test</a> <a href="">about</a> <a href="">test</a> </nav>
css
body { margin: 0; } nav { height: 80px; align-items: center; background: #eee; display: flex; justify-content: space-around; } { color: rgba(0, 0, 0, 0.8); font-size: 0; transition: 0.3s; text-decoration: none; } a:first-letter { font-size: initial; } a:hover { font-size: initial; }
body { margin: 0; } nav { height: 80px; align-items: center; background: #eee; display: flex; justify-content: space-around; } { color: rgba(0, 0, 0, 0.8); font-size: 0; transition: 0.3s; text-decoration: none; } a:first-letter { font-size: initial; } a:hover { font-size: initial; }
<nav> <a href="">about</a> <a href="">test</a> <a href="">about</a> <a href="">test</a> </nav>
Comments
Post a Comment