![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Can anyone explain why the following code results in different padding for the 2 table cells? i.e. the Linked Item cell is higher than the Not Linked cell and there is a gap between the edge of the cell and the start of the text. |
#2
| |||
| |||
|
|
J Williams wrote: Can anyone explain why the following code results in different padding for the 2 table cells? i.e. the Linked Item cell is higher than the Not Linked cell and there is a gap between the edge of the cell and the start of the text. Because you told it to. ;-) td.lnavhead a { display: block; padding: 4px; text-decoration: none; } With 4px of padding (top, right, bottom, and left), it should be 8 pixels higher. Remove the padding and the size should match. Gary |
#3
| |||
| |||
|
Thanks, that's perfect . |
|
I was missing several things, particularly the span> tag and the * in the 2nd style. |
#4
| |||
| |||
|
|
You should also consider to use an unordered list instead of a table for the navigation. It keeps the code smaller and is more reasonable markup. ul id="nav" li><a href="">link</a></li li><a href="">link</a></li li><span>no link</span></li /ul |
#5
| |||
| |||
|
|
Using an ordered list instead of a table is often suggested, but I've always wondered how to do it, whilst keeping the same positioning and formatting (fore and background colours, mouse hover effect, 1 menu item per row, etc.) that a table (or nested table) provides. I'd like to have a go at changing my navigation menus to use unordered lists, whilst keeping the current look and feel. Any pointers to HTML code or guides and tutorials on the web for doing this would be much appreciated. |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |