mrtunes — 2010-05-06T11:04:50-04:00 — #1
you can't really make li items link from what i know. but often i'd like the whole area of one to be clickable. one trick i have found is setting the height of the li to be 1%. but not sure what css needs to be applied the a property. anyone have examples of this?
making a cell of a calendar clickable is one application of what i'm talking about.
paulob — 2010-05-06T11:50:09-04:00 — #2
Anchors are inline elements and therefore they have no height or width apart form the content they hold. To make them stretch the full width of their parent you need to set them to display:block.
IE6 needs haslayout to make the whole area active which is where you saw the height:1% hack being used but it must be given only to ie6.
Some examples here:
mrtunes — 2010-05-06T11:56:48-04:00 — #3
thank you! the interesting thing about that example is i don't see height declared anywhere.
paulob — 2010-05-06T12:20:11-04:00 — #4
You would only need a height if the parent had a height defined
At present it is the content creating the height so it will stretch the parent automatically so parent and child are always the same height.
If you set the parent to height 300px for example then the content would only be 100px high and the background would only change on the content and not the whole parent. In that case you'd need a height on the child also to match.
Most times you would want to avoid setting heights unless you are trying to make a number of elements the same size. the problem with setting a height is that it can never grow and if text is resized or content increased the content will overflow.
mrtunes — 2010-05-06T19:36:15-04:00 — #5
i did a quick experiment armed with your info, and i seem to have it figured out. thank you