div#minha_div and #my_div
In the first case you are selecting a div
that has the id
#minhadiv
. Ex.:
<div id="minha_div"></div>
In the second, you are selecting any element who owns the id
#minhadiv
, that need not necessarily be a div
. Ex.:
<input id="minha_div">
#wrapper #top #menu
Here you are making a selection by hierarchy: the #menu
is the son of #topo
who is the son of #wrapper
.
This form of selection is unnecessary in this case because as a id
should be unique on the page, you can simply select only the #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 you find in #menu
but does not want to select one that exists elsewhere. Ex.:
#menu li{
color: red;
}
#menu .ativo{
font-weight: bold;
}
Edge height
The edge only owns the property border[-top|right|bottom|left]-width
that is just the thickness. If you want to create a pseudo-edge to give an effect that the edges right or left have a "height" that is not normal, may resort to gambiarras pseudo-elements, such as ::before
and ::after
.