CSS - HTML Text is highlighting where it shouldn't be -
so i'm working on website scratch, put online see issue. basically, when aim cursor towards logo, if aim right of it raise opacity of logo too. want logo brighten when hover on brightens when put mouse anywhere on navbar. thank help! site: http://www.saylorstudios.com/
html:
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>saylor studios</title> <link rel="stylesheet" href="css/normalize.css" media="all" rel="stylesheet" type="text/css"/> <link href='http://fonts.googleapis.com/css?family=josefin+sans:300,400,600,700' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"/> </head> <body> <div class="background-canvas" style="height: 825px"> <header> <section class="navbar"> <div class="logotogether"> <a href="index.php" id="logo"><img src="img/logo.png" alt="logo"><p class="logotext">saylorstudios</a></p> </div> <nav> <ul> <li class="services <?php if ($section == "services") { echo "on"; } ?>"><a href="services.php">services</a></li> <li class="portfolio <?php if ($section == "portfolio") { echo "on"; } ?>"><a href="portfolio.php">portfolio</a></li> <li class="contact <?php if ($section == "contact") { echo "on"; } ?>"><a href="contact.php">contact</a></li> </ul> </nav> </section> </header>
css:
header { height: 50px; } .navbar { max-width: 960px; margin: 0px auto; } .navbar img { float: left; } .logotext { margin-top: 0; padding-top: 18px; } .logotext { text-decoration: none; color: #fff; font-weight: 600; font-size: 1.8em; margin-left: 5px; } .logotogether { opacity: 0.8; } .navbar img { padding-top: 10px; } nav { text-align: center; } nav ul { list-style: none; float: right; margin-top: -20px; } nav li { display: inline; } nav ul li { padding-left: 10px; padding-right: 10px; opacity: 0.8; text-decoration: none; color: #fff; font-size: 1em; font-weight: 400; margin-top: 0; } .logotogether:hover { opacity: 1;
you solve problem adding 1 more container after class `logotogether' , give width of 200px. set opacity 0.8, use hover pseudoselector on container , set opacity 1. can add transitions. if worked please accept answer.
html
<div class="logotogether"> <div class="hoverclass"> <!-- add container here --> <a href="index.php" id="logo"><img src="img/logo.png" alt="logo"></a> <p class="logotext"><a href="index.php" id="logo">saylorstudios</a></p> </div> </div>
css
.hoverclass { width: 200px; opacity: 0.8; } .hoverclass:hover { opacity: 1; }
Comments
Post a Comment