Peuplarchie Posted January 31, 2010 Share Posted January 31, 2010 Good day to you all, I was wondering if there is a way to change the the look of wach level of a list. Ex: Last level, text = link 1st level, has 1 image instead of bullet and text in bold 2nd level as another image as bullet and text in bold 3rd level, if not last level, as another image as bullet and text in bold\ Here is where I'm now : <html> <head> <style type="text/css"> ul { list-style-image: url(Icons/open_book_icon.jpg); } li { list-style-image: url(Icons/box_icon.png); } </style> </head> <body> <?PHP function globDir($dir) { $files = glob("$dir/*", GLOB_ONLYDIR); if(!empty($files)) { echo "<ul>\n"; foreach($files as $file) { echo "<li><b>". basename($file)."</b>\n"; globDir($file); echo "</li>\n"; } echo "</ul>\n"; } } globDir('Photos'); ?> </body> </html> Thanks ! Link to comment https://forums.phpfreaks.com/topic/190458-unordered-list-replace-bullet-by-image-according-to-level-if-last-level-text-as/ Share on other sites More sharing options...
teamatomic Posted January 31, 2010 Share Posted January 31, 2010 How are you building the list. if its with a script the you know if its a sub-level. if so use ID's <ul id=one> <li> <ul id=two> <li> </ul> </ul> #one ul { list-style-image: url(Icons/open_book_icon.jpg);} #one li {list-style-image: url(Icons/box1_icon.png);} #two ul { list-style-image: url(Icons/closed_book_icon.jpg);} #two li {list-style-image: url(Icons/box2_icon.png);} HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/190458-unordered-list-replace-bullet-by-image-according-to-level-if-last-level-text-as/#findComment-1004731 Share on other sites More sharing options...
Peuplarchie Posted January 31, 2010 Author Share Posted January 31, 2010 What I really tried to obtain is : Folder that has folder in them use one icon Folder that has files it them use another icon Can I do it ? Link to comment https://forums.phpfreaks.com/topic/190458-unordered-list-replace-bullet-by-image-according-to-level-if-last-level-text-as/#findComment-1004745 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.