css change hover size depending on header length -


enter image description here

hello im new this. have created webpage links running horizontally across page. when hover on each title has background colour. hover size fixed size. want know how can hover automatically adjust depending on link length. /* change link color #272727 on hover */

li a:hover     {         background-color:#272727;         max-width:200px;     } 

thanks help

it looks me "max-width: 200px;" css property isn't required. try:

li a:hover {     background-color:#272727; } 

without specifying explicit max width, link elements size width of parent li. when set background colour on hover, entire word highlighted, without overflow.

but if provide fiddle confirm, that'd helpful!


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -