May 8th, 2008Using CSS rules with AllWebMenus
Scripts generated by the AllWebMenus DHTML Menu Maker application create HTML <table> elements (and thus <tr> and <td> elements) in order to display the menu in your website.
Generic CSS rules that apply to all elements of a certain type (such as table) will also affect the elements created by the AllWebMenus' scripts. This can cause strange appearance of a menu.
Here is an example:
The original menu looks like this:
CSS rules like the following:
td {
text-align: center;
margin: 0.5em;
font-size: 100%;
color: black;
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px
}
and
tr {
text-align: left;
margin: auto;
font-size: 100%;
color: black;
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px
}
will cause a menu to look like this:
Instead of the above rules, you can use classes and add these classes to the elements of the page you want the CSS rules to be applied:
td.TDdefinition {
text-align: center;
margin: 0.5em;
font-size: 100%;
color: black;
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px
}
and
tr.TRdefinition {
text-align: left;
margin: auto;
font-size: 100%;
color: black;
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px
}
and in the source code of your page you can use the following
<table …>
<tr class=”TDdefinition” …>
<td class=”TRdefinition” …>
...
</td>
</tr>
</table>
in the tables you want these CSS rules to be applied.
Tags: AllWebMenus, CSS, DHTML Menu Maker, JavaScript, Menu, styles