html-lists

jQuery: excluding root element of a list tree (ul)

别说谁变了你拦得住时间么 提交于 2019-12-11 02:36:27
问题 I've been using a piece of jquery code from stack overflow. Here's the link to the page: https://stackoverflow.com/questions/2...76196#13976196 I need to hide a large UL tree structure except the root elements. The code above works great except I can't understand the following line: Code: $('ul, li', $('#lesson-sidebar ul li')).hide(); That code hides all of the UL and LI items in the lists, but excludes the root elements. I don't understand how adding $('#lesson-sidebar ul li') as a selecond

“Unexpected indentation” with restructuredtext list

倖福魔咒の 提交于 2019-12-11 01:49:12
问题 I did not succeed to get a simple 3 levels indented list with Restructuredtext: $ cat test.rst Title ====== - aaaa - aaaa2 - aaaa2 - aaaa3 - aaaa - aaaa Ok $ rst2html test.rst > /tmp/a.html test.rst:7: (ERROR/3) Unexpected indentation. $ I've try different combination of spaces in front of aaaa3 but I get in all cases (ERROR/3) Unexpected indentation. 回答1: Nested lists are tricky because different levels require blank lines between those levels. Nested lists are possible, but be aware that

<ul> height is 0 in this code, why? (it has to do with overflow:hidden)

﹥>﹥吖頭↗ 提交于 2019-12-11 01:46:15
问题 Please refer to the following code: <!DOCTYPE html> <html> <head> <style> ul { border: 1px solid red; list-style-type: none; margin: 0; padding: 0; /*overflow: hidden;*/ /* Remove this comments */ background: yellow; } li { border: 1px solid red; float: left; } li a { display: block; /* what is this used for here? */ color: black; text-align: center; padding: 16px; text-decoration: none; } li a:hover { background-color:red; } </style> </head> <body> <ul> <li><a href="#home">Home</a></li> <li>

Sharing options between selects (using HTML and jQuery)

蓝咒 提交于 2019-12-11 00:44:19
问题 Looked through many answers, but couldn't find one solving this. I have four (potentially n-number of) <select> lists, with an equal number of <option> possibilities in each, like this: <label>Pick a:</label> <select class="colorassign"> <option value="1" selected="selected">One</option> <option value="2">Two</option> <option value="3">Three</option> <option value="4">Four</option> </select> <label>Pick b:</label> <select class="colorassign"> <option value="1">One</option> <option value="2"

Ordered list number with css multiple column

萝らか妹 提交于 2019-12-10 23:09:19
问题 I am creating an ordered list with the default numbering. The list would be more than 300. I have divided into columns using css- column-count which divides the list into columns but the default list numbering is present only for the first column. Is there a way to get the numbering for the whole list in multiple columns. Please check FIDDLE .bucketcol{ float:left;margin-right:10px; -webkit-column-count: 3; -moz-column-count: 3; column-count: 3; height:100px; } .bucketcol li{ width:110px; }

Align list items with custom CSS content before bullets

假装没事ソ 提交于 2019-12-10 22:06:46
问题 I have this snippet of HTML: <ul class="custom"> <li data-bullet="a">Item 1</li> <li data-bullet="aa">Item 2</li> <li data-bullet="ab">Item 3.1<br/>Item 3.2</li> <li data-bullet="c">Item 4</li> <li data-bullet="d">Item 5</li> <li data-bullet="de">Item 6</li> </ul> and CSS: .custom { list-style:none; padding:0; margin:0; } .custom li:before { display:inline-block; content:attr(data-bullet); width:50px; } /* .custom { list-style:none; padding:0; margin:0; } .custom li:before { display:inline

innerHTML causing ul to self-close

一曲冷凌霜 提交于 2019-12-10 21:15:45
问题 I'm trying to display a Twitter feed by pulling from a cached text file and looping through the tweets. Works fine until I try to turn these tweets into a list. The li elements append to the innerHTML properly, but the opening ul self-closes, and the ending ul disappears. function twitterStatusCallback(obj) { if(obj && obj.length){ document.getElementById('twitter_status').innerHTML += "<ul>"; var len = obj.length; for(var i = 0; i < len; i++){ //Only get tweets less than 7 days old. if (

PHP Generate UL LI , UL LI

自作多情 提交于 2019-12-10 18:14:47
问题 Can't figure out how-to generate this menu using a while-loop. This is an example of my code: <ul id="nav"> <li><a href="#">Hoofdmenu 1</a> <ul class="sub"> <li><a href="#">Submenu 1.1</a></li> <li><a href="#">Submenu 1.2</a></li> <li><a href="#">Submenu 1.3</a></li> <li><a href="#">Submenu 1.4</a></li> </ul> </li> <li><a href="#">Hoofdmenu 2</a> <ul class="sub"> <li><a href="#">Submenu 2.1</a></li> <li><a href="#">Submenu 2.2</a></li> <li><a href="#">Submenu 2.3</a></li> <li><a href="#"

Javascript: can't add href to list item

こ雲淡風輕ζ 提交于 2019-12-10 17:43:07
问题 I am trying to add a new item to a list item. But the below code isn't adding Hyperlink to the list item I want. Can someone please advise what's wrong? HTML: <div> <ul id="list1"> <li>Ut enim ad minim veniam.</li> <li>Excepteur sint occaecat cupidatat non proident.</li> </ul> </div> JavaScript: //create new li element var newListItem = document.createElement("li"); newListItem.textContent = "...ooo"; var ulist = document.getElementById("list1"); console.log("adding link.."); newListItem

Semantic HTML: List of Users

自闭症网瘾萝莉.ら 提交于 2019-12-10 17:36:19
问题 How should I mark up a list of users? Each user has a name, picture, and job title. How's this? <h1>Venmo</h1> <h2>Employees</h2> <ul> <li> <article> <img src="http://www.gravatar.com/avatar/7e6e0e2b73358e47e0b7f83f8111f75b"> <h3>Matt Di Pasquale</h3> <p>Software Engineer</p> </article> </li> <!-- ... --> </ul> Should I remove the article elements? Should I remove the ul & li elements? 回答1: This isn't so much a list of users as a table of data about the users. Each user has an image, a name