html-lists

Randomize a unordered list [duplicate]

落爺英雄遲暮 提交于 2019-12-06 15:27:28
This question already has answers here : Closed 8 years ago . Possible Duplicate: javascript - shuffle HTML list element order After a little bit of help. After something quite simple, but can't seem to find a way of doing it myself. I've got a dynamic unordered list being generated from some back end code, (not under my control). The list can be anything from 9 tags up to 100+. They are returned in an order, as defined by the backend code. Using jQuery/javascript I would like to be able to randomize the order of the li tags without having any of them repeat. My my list would currently look

setting overflow hides li bullets (overflow property conflict with list-style)

时间秒杀一切 提交于 2019-12-06 13:55:43
问题 setting overflow and text-overflow property makes the li hide bullets. I've tried putting the bullets "inside" but it still didn't show bullets. Plus I'd prefer to put it "outside" ul.hbox_poplist { list-style: circle url('/img/bpt_clear.png'); } ul.hbox_poplist li { margin: 0 0 8px; max-height:32px; text-overflow: ellipsis; overflow-y: hidden; } does anyone know any solution to this? 回答1: Using a CSS background is much more dependable across browsers than using list-style-image for custom

Vertical Align Unordered List Nav Links?

别等时光非礼了梦想. 提交于 2019-12-06 12:21:26
问题 I see that this question has been asked many times but I think my case is slightly different. The navigation for the site I am working on is constructed with an unordered list like so: <div class="nav_root nav_area_top"> <ul class="nav_root_wrap"> <li class="nav_parent first"> <a href="california.providence.org/torrance/pages/Locations.aspx"> Locations </a> </li> <li class="nav_parent first"> <a href="california.providence.org/torrance/pages/Locations.aspx"> Health Services </a> </li> </ul> <

itext XMLWorkerHelper ignores value attribute of <li> tag

不想你离开。 提交于 2019-12-06 11:59:35
I'm using itext 5.4.5 with XMLWorker 5.4.5 to generate pdf from html that cames from ckEditor. Users can also paste some text from word documents and this results sometimes in something like this: <ol> <li value="3">some text1</li> </ol> <div>lorem ipsum dolor</div> <ol> <li value="100">some text2</li> </ol> <div>lorem ipsum dolor</div> <ol> <li value="77">some text3</li> </ol> this results in ckEditor and in html as 3. some text1 lorem ipsum dolor 100. some text2 lorem ipsum dolor 77. some text3 But if itext convert this html to pdf, it ignores the value of li-tags and sets it to "1." and

jquery ordering and group li elements

你说的曾经没有我的故事 提交于 2019-12-06 11:09:07
问题 Let's say I have a list of items under a div or UL. I want to take all the list items with the same title attribute and wrap a UL around it. The next part though is that I want that UL to be under the LI with the same attribute. So, I'm trying to group basically. So.... I start with..... <li>Insurance</li> <li>Education</li> <li>Sports</li> <li>Construction</li> <li title ="Insurance">Malpractice</li> <li title ="Construction">Carpentry</li> <li title ="Education">College</li> <li title =

Create <select> from list - indent child items?

半城伤御伤魂 提交于 2019-12-06 10:17:20
问题 I have a UL LI menu that I am turning into a select dropdown when you're viewing it on a mobile. I want to now indent child items e.g List item 1 -- Child item 1 ---- Child Child item 1 -- Child item 2 List item 2 Rather than listing in one single line. I'm happy to just add nbsp to keep things easy - or add classes and CSS if more suitable. The code I am currently using to generate the select is: $("<select />").appendTo("#primary-nav"); $("<option />", { "selected": "selected", "value" : ""

Again: CSS, UL/OL: Incorrect indent with custom counter

旧街凉风 提交于 2019-12-06 08:56:05
I described my original problem in this thread . In short, when using custom counters in ULs, the text indentation broke. Marc Audet proposed a very elegant solution which I implemented in our code. Now - not surprising - this does not work if the list is supposed to float around images :-( You can see the problem here: http://cssdesk.com/eEvwn The numbers are lying on top of the image. Again: no surprise, they are absolutely positioned after all. So. Is there a way to fix this, or do I have to make my client unhappy by telling him it's technically not possible? Thank you again for taking the

Space between menu and drop down menu

萝らか妹 提交于 2019-12-06 08:17:23
I'd like for the drop down menu to show below the border line in the main menu area instead of showing up right underneath the 'menu' title/button. I can change the positioning so that it is lower but then there is dead space in between that makes it impossible to mouse over the drop down menu. I don't want to add padding above the drop down because that just created more purple space, where I want that space to be empty. Below is the code but feel free to view here: link html: <div class="menu-box fl"> <ul class="menu"> <!-- Begin Item With Drop --> <li class="drop"> <a href="#"><span class=

jQuery - How can i dynamically add a list item to an unordered list?

夙愿已清 提交于 2019-12-06 05:54:42
问题 Seems like a simple thing to do (although im still learning the ins and outs of jQuery). Here's my HTML: <div id="fbsignup"> <div class="message messageerror"> <strong>There were errors with your registration:</strong> <ul></ul> </div> </div> Here's my (attempted) jQuery: // Check Required Fields. $('#fbsignup input.required').each(function () { if ($(this).val().trim() == '') { $(this).next('em').html('*').show(); $('#fbsignup .message ul').add('li').html('Fields marked with * are required.'

Centering lists in Zurb Foundation

核能气质少年 提交于 2019-12-06 00:16:03
问题 I am having trouble centering inline lists when using Zurb's Foundation 4. The prebuilt css classes of 'text-center' and 'centered' work fine for other elements but not with lists. A review of an older question concerning images has similar results. This doesnt work: <div class="row"> <div class="large-12 columns text-center"> <ul class="inline-list"> <li><a href="#">One</a></li> <li><a href="#">Two</a></li> <li><a href="#">Three</a></li> <li><a href="#">Four</a></li> <li><a href="#">Five</a>