What you need to "fix" is the last <li>
of the list, not the last <a>
. That’s because the <a>
is the son of <li>
and is not exactly on the list. You should also apply the other properties to <li>
, and not us <a>
. For example, here:
ul.lista li,
ul.lista li a {
list-style: none;
list-style-image: none;
list-style-type: none;
}
You are resetting properties of <a>
that do not exist.
It should just be:
ul.lista li{
list-style: none;
list-style-image: none;
list-style-type: none;
}
In this passage also:
ul.lista li a {
padding: 2px 2px;
border-bottom: 1px solid #AFAFAF;
}
If you want to make a vertical menu with using list, who should have these edge properties and internal spacing were the <li>
, and not the <a>
. Would look like this:
ul.lista li{
padding: 2px 2px;
border-bottom: 1px solid #AFAFAF;
}
And finally, to fix the last <li>
, as reported in the other reply, you should also apply the properties in the last <li>
:last-child
, and not a:last-child
, because otherwise it will apply to all <a>
of the list, because all the <a>
sane :last-child
. Would look like this:
ul.lista li:last-child {
border-bottom: 0px;
position: absolute;
left: 0;
bottom: 0;
}
Example:
ul.lista {
height: 200px;
background: gray;
position: relative;
}
ul.lista li{
list-style: none;
list-style-image: none;
list-style-type: none;
}
ul.lista li{
padding: 2px 2px;
border-bottom: 1px solid #AFAFAF;
}
ul.lista li:last-child {
border-bottom: 0px;
position: absolute;
left: 0;
bottom: 0;
}
<ul class="lista">
<li><a href="">Link#01</a></li>
<li><a href="">Link#02</a></li>
<li><a href="">Link#03</a></li>
<li><a href="">Link#04</a></li>
<li><a href="">Link#05</a></li>
<li><a href="">Todos</a></li>
</ul>
Could elaborate a [mcve] demonstrating what you want to do?
– Woss
@Andersoncarloswoss is exactly what I intend, a north for example, is to fix the last <LI> in height: 500px; regardless of the amount of other <LI> and stay there, I do not know how to do.
– ElvisP
You want the last LI always stick to the base of the parent container?
– hugocsl