| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Everything is fine.
|
auto-expanding LI elements in a list
I'm having one of those days and can't get this to perform as needed. Basically I have a dynamically generated horizontal OL (fixed width of 960px) with which I'm populating the LI elements. The number of LI elements can vary per page. What I would like is the size of the LI elements to automatically expand to fill the width of the OL. So if there are two LI's then their widths would be 480px each. Or if there were 6 items the size of the LI's would be 160px each. Is there an easy way in CSS to accomplish this ? I'd rather not use JS if possible. Any help would be greatly appreciated. |
|
|
|
|
|
#2 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,551
|
I don't think this can be done without making your CSS into a dynamic document using PHP or some other server side language. CSS at it's core doesn't work dynamically, although there are ways to kind of hack it or trick it into working dynamically. |
|
|
|
#4 (permalink) |
|
Everything is fine.
|
Just because, I decided to write some JavaScript to make this work, it's online at: Auto Expanding LI Elements If anyone is interested... |
|
![]() |