div # my_div and #minha_div
In the first case you are selecting a div
that has id
#minhadiv
. Ex.:
<div id="minha_div"></div>
In the second, you are selecting any element that has id
#minhadiv
, which does not necessarily have to be div
. Ex.:
<input id="minha_div">
#wrapper #topo #menu
Here you are making a selection by hierarchy: #menu
is the child of #topo
that is the child of #wrapper
.
This form of selection is unnecessary in this case because since a id
must be unique on the page, you can simply select only #menu
direct, not to mention your parents and grandparents.
This is usually done with classes or tags, because you may want to select a class or tag that is in #menu
but you do not want to select one that exists elsewhere. Ex.:
#menu li{
color: red;
}
#menu .ativo{
font-weight: bold;
}
Edge Height
The border only has the border[-top|right|bottom|left]-width
property, which is nothing more than the thickness. If you want to create a pseudo-border to give an effect that the right or left borders have a "height" other than normal, you can use gambiarras pseudo-elements, such as ::before
and ::after
.