Мой код ниже создан на основе StaticItemTemplate в меню ASP:.DIVS не проверяется при использовании в пользовательском ASP: Меню
Код и ссылка делают то, что вам нравится, однако это не помогает.
Выходной код выглядит следующим образом
<li>
<a class="level1 StaticMenuItemStyle" href="/Services.aspx">
<div class="StaticMenuItemStyle"
onmouseover="style.backgroundColor='#0088CB';style.color=white;"
onmouseout="style.backgroundColor='';"
style="color:Color [Blue];width:180px;">
<a href="/Services.aspx" class="StaticMenuItemStyle">Services</a>
<br />
<div style="background-color: Blue; width: 180px;height: 5px;"></div>
</div>
</a>
</li>
однако это ошибки на W3Validator
Line 84, Column 63: document type does not allow element "div" here; missing one of
"object", "ins", "del", "map", "button" start-tag
style="color:Color [Blue];width:180px;">
The mentioned element is not allowed to appear in the context in which you've placed
it; the other mentioned elements are the only ones that are both allowed there and
can contain the element mentioned. This might mean that you need a containing
element, or possibly that you've forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level
element (such as "<p>" or "<table>") inside an inline element (such as "<a>",
"<span>", or "<font>").
Однако, если я заменить DIV с пролетом он проверяет. но не выглядит правильно. У кого-нибудь есть идеи, как обойти это?