list - how to keep position of other link when mouse is over a link-html Css? -
i have ul list float:right li. want set center of page. margin , left doesnt work well.
i want when mouse on link ,keep position of other link , dont move forward.
my css code this:
#menu2 li { -webkit-transition: 0.3s ease; -moz-transition: 0.3s ease; -o-transition: 0.3s ease; -ms-transition: 0.3s ease; transition: 0.3s ease; } #menu2 li a:hover { border: none; font-size: 30px; } <!--===============================================================<!--===============================================================--> --> ul, li { display: inline-block; } #menu2 ul { list-style-type: none; background-color: #003; text-align: center; } #menu2 li { float: left; list-style-type: none; padding: 15px 15px; } #menu2 { min-width: 800px; margin-top: 15%; right: 65% !important; } #menu2 li { display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; background-color: #093; transition: 0.5s ease 0s; font-size: 18px; min-width: 95px; border-radius: 50px; }
<div align="center" style="height:100%;width:100%;"> <div class="menu" id="menu2" align="center"> <ul> <li><a href="brands.php">brands</a></li> <li><a href="contact.php"> contact </a></li> <li><a href="price.php"> price list </a></li> <li><a href="about.php"> about </a></li> <li><a href="index0.php"> home </a></li> </ul> </div> </div>
how can solve this??? use a:after doesnt work.
i have added css, changed hover text size 25px , button width 135px , added in whitespace:nowrap anchor tags.
what happening when hover text grow , wrap because not fit containers, turned wrap off , made button containers width bigger fit when enlarged
i hope after buttons no longer move around page when hovered on.
edit: added css ul tag = float:left; buttons sit inside , achieve dark blue background.
css
#menu2 li { -webkit-transition: 0.3s ease; -moz-transition: 0.3s ease; -o-transition: 0.3s ease; -ms-transition: 0.3s ease; transition: 0.3s ease; } #menu2 li a:hover { border:none; font-size:25px; /*changed steve */ } <!-- =============================================================== <!--=============================================================== --> --> ul,li { display:inline-block; } #menu2 ul { list-style-type: none; background-color: #003; text-align:center; float:left; } #menu2 li { float: left; list-style-type:none; padding:15px 15px; } #menu2 { min-width:800px; margin-top:15%; right:65% !important; } #menu2 li { display: table-cell; vertical-align:middle; color: white; text-align: center; text-decoration: none; background-color:#093; transition: 0.5s ease 0s; font-size:18px; min-width:95px; width:135px; /*changed steve*/ height:48.8px; border-radius: 50px; white-space:nowrap; /*added steve */ }
Comments
Post a Comment