3
I have an unordered list that has some list items and would like to place a horizontal line (horizontal Rule < hr >) on it, right in the middle, with height of 2px. I tried to put vertical-align: middle
but the line was on top of the list items. I’d like to put it behind them, it must have some css property that allows this.
List items may appear or not, depending on other factors. That is, whether or not there are list items, the horizontal line should always be in the middle of the div.
Any hint?
Follow the code I have.
<ul>
<hr style="height:2px; border:none; color:#000; background-color:#000; margin-top: 0px; margin-bottom: 0px;">
<? if($primeiro_ponto != NULL && $ultimo_ponto != NULL && $quantidade_de_trajetos>0){foreach($conteudos as $ils){ echo $ils; }}?>
</ul>
Avoid making big titles...
– Silvio Andorinha
I do this kind of thing very often in menus...it’s simpler than it looks, I’ll provide you with a very practical example.
– Leandro RR