html-lists

open closest ul on click jQuery

梦想与她 提交于 2021-01-29 02:45:27
问题 when clicking a.market-metro, open closest ul.children. <ul class="drop-padding"> <li> <a class="market-metro">text</a> <ul class="children">...</ul> </li> <li> <a class="market-metro">text</a> <ul class="children">...</ul> </li> <li> <a class="market-metro">text</a> <ul class="children">...</ul> </li> I have the following but not working: jQuery(".market-metro").click(function(){ if (jQuery(".market-metro").closest('li').find('ul.children').hasClass("expanded")) { jQuery(".market-metro")

C# Create HTML unordered list from List using Recursion

我与影子孤独终老i 提交于 2021-01-28 10:17:10
问题 Is it possible to output the following HTML unordered list using recursion. <ul> <li>1 <ul> <li>5 <ul> <li>8</li> <li>9</li> </ul> </li> <li>6</li> </ul> </li> <li>2</li> <li>3</li> <li>4</li> <li>7</li> </ul> Where the original data is is held in the following list List<Page> pages = new List<Page>(); pages.Add(new Page { Id = 1, pageId = 1, parentPageId = 0 }); pages.Add(new Page { Id = 2, pageId = 2, parentPageId = 0 }); pages.Add(new Page { Id = 3, pageId = 3, parentPageId = 0 }); pages

putting text and images on same line within a list item - html/css

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-27 13:46:54
问题 I was wondering if anyone could help me out with a small html/css issue I am having. Basically, I am trying to make a unordered list with a different image for the bullet of each list item, with a text to the right on the same line. More specifically, a header on the top line and some normal text below. At the moment, I can get the image and the text on the same line :-( Here is my code. Any help would be greatly appreciated. Html: <ul> <li class="service-list"> <a href=""><img src="image.png

styling a nested list in CSS

被刻印的时光 ゝ 提交于 2021-01-05 07:33:46
问题 According to this well-rated SO post Proper way to make HTML nested list? the best-practice way to make a nested list is this: <ul> <li>List item one</li> <li>List item two with subitems: <ul> <li>Subitem 1</li> <li>Subitem 2</li> </ul> </li> <li>Final list item</li> </ul> however I'm having real problems styling a list made in this way. I want each item in the list to have a specific height but I can't use li { height: 40px; } because the height of the second li also includes all the inner

styling a nested list in CSS

早过忘川 提交于 2021-01-05 07:33:27
问题 According to this well-rated SO post Proper way to make HTML nested list? the best-practice way to make a nested list is this: <ul> <li>List item one</li> <li>List item two with subitems: <ul> <li>Subitem 1</li> <li>Subitem 2</li> </ul> </li> <li>Final list item</li> </ul> however I'm having real problems styling a list made in this way. I want each item in the list to have a specific height but I can't use li { height: 40px; } because the height of the second li also includes all the inner