1
I have a <aside>
and within it a structure ul>li
(menu) according to the code below, I would like that when clicking on the item and the page of the same one is redirected, the menu is selected the same with the effect of the Hover and the + signal is - ...
I tried using css :target
but it didn’t work out because I would have to use #nome-page
and ended up not rolling .. then wanted to know via jquery what better way to do ... follows the code and image ...
@import "../main";
.aside
{
width: 100%;
max-width: 290px;
position: relative;
margin-top: 90px;
padding-right: 15px;
float: left;
.aside-bg
{
background-color: #cac5b0;
max-width: 275px;
width: 100%;
padding: 15px 0 10px 0;
margin-bottom: 30px;
}
.aside-bg:last-child
{
padding: 15px;
}
.aside-bg:last-child ul li
{
width: 100%;
background-color: #fff;
padding: 10px;
&:hover
{
background-color: #fff;
}
}
.aside-bg:last-child ul li a
{
font-family:'Optimist';
@include font-size(22);
color: #061f5c;
text-transform: uppercase;
letter-spacing: 1px;
}
.aside-bg:last-child ul span
{
padding: 10.5px;
color: #fff;
}
.aside-bg ul
{
}
.aside-bg ul li
{
width: 105%;
background-color: #061f5c;
padding: 18.5px;
margin-bottom: 25px;
position: relative;
&:hover
{
background-color: #ff5800;
}
}
.aside-bg ul li:target
{
background-color: #ff5800;
}
.aside-bg ul li:last-child
{
margin-bottom: 0;
}
.aside-bg ul li a
{
font-family:'Optimist';
@include font-size(24);
color: #fff;
text-decoration: none;
}
.aside-bg ul li a span
{
position: absolute;
top: 0;
right: 0;
padding: 19px 25px;
background-color: #ff5800;
}
.aside-bg h2
{
font-family:'Optimist';
@include font-size(35);
color: #0a2677;
width: 100%;
text-align: center;
margin: 0;
}
.aside-bg img
{
margin-top: 25px;
margin-bottom: 25px;
width: 100%;
}
}
<aside class="aside col-xs-12 col-sm-5 col-md-5">
<div class="aside-bg">
<ul>
<li class="aside-link1"><a href="formags">A FORMAG'S <span>+</span></a></li>
<li class="aside-link1"><a href="historia">NOSSA HISTÓRIA <span>+</span></a></li>
<li class="aside-link1"><a href="tecnologias">TECNOLOGIAS <span>+</span></a></li>
<li class="aside-link1"><a href="sustentabilidade">SUSTENTABILIDADE <span>+</span></a></li>
</ul>
</div>
<div class="aside-bg">
<h2>Não é só impressão</h2>
<img src="assets/img/icon-aside.png" alt="Icones">
<ul>
<li class="aside-link1"><a href="formags">solicite seu orçamento<span>+</span></a></li>
</ul>
</div>
</aside>
I’ve never seen anyone make key inside the CSS key, as far as I know, it only works with media queries, (and Sass or Less before compilation)... In case it should be something like this:
aside {...} aside.aside-bg {...}
and notaside { .aside-bg{... } }
– Ivan Ferrer
by nested CSS rules this looks SASS or LESS
– Pedro Sanção
@Ivanferrer Sorry maybe I didn’t mention but this is SASS
– user27585
That’s what I figured, it’d be a SCSS
– Ivan Ferrer