html-lists

Bottom to top <ul> element arrangement

不想你离开。 提交于 2019-12-03 23:36:56
I'm trying to find out how I can force elements to start from the bottom going to the top. I have searched through stackoverflow and I can't seem to get the answer that i need. This picture should explain it: This should help too: <?php require("connectdb.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jQuery Dynamic Drag'n Drop</title> <script type="text/javascript" src="javascript

Skip ordered list item numbering

百般思念 提交于 2019-12-03 22:37:04
I have an ordered list and I'd like to skip the number output from a particular item. Traditional output: 1. List item 2. List item 3. List item 4. List item 5. List item Desired output: 1. List item 2. List item Skipped list item 3. List item 4. List item 5. List item Is this achievable in CSS? I discovered an <ol> "start" attribute that I didn't know about before, but doesn't seem to help me. Another option is to use CSS3 counters: demo HTML <ul> <li>One</li> <li>Two</li> <li class="skip">Skip</li> <li>Three</li> <li>Four</li> </ul>​ CSS ul { counter-reset:yourCounter; } ul li:not(.skip) {

Python OrderedSet with .index() method

荒凉一梦 提交于 2019-12-03 21:51:03
问题 Does anyone know about a fast OrderedSet implementation for python that: remembers insertion order has an index() method (like the one lists offer) All implementations I found are missing the .index() method. 回答1: You can always add it in a subclass. Here is a basic implementation for the OrderedSet you linked in a comment: class IndexOrderedSet(OrderedSet): def index(self, elem): if key in self.map: return next(i for i, e in enumerate(self) if e == elem) else: raise KeyError("That element

Why can't an <ul> (with absolute position) inside a <li> (with relative position) auto size?

可紊 提交于 2019-12-03 17:39:11
问题 EDIT: see also my own answer below (2016) For example: <ul> <li class="first"><a href="#" title="">Home</a></li> <li><a href="#" title="">Chi siamo</a> <ul><li><a href="#" title="">item1</a></li><li><a href="#" title="">item2</a></li></ul> </li> <li><a href="#" title="">Novità</a></li> <li><a href="#" title="">Promozioni</a></li> </ul> Then styled: /* level 1 Main menu ----------------------------------------- */ #main-menu > ul{ list-style:none; } #main-menu > ul > li{ float:left; display

bulleted list with different indentation

一曲冷凌霜 提交于 2019-12-03 17:04:49
问题 Can I make bulleted lists on my site that use <ul> and <li> tags have a different indentation distances? Element One Element Two and even this line which is not in an <li> tag are indented List elements without the <ul> tags are not indented I would like to indent some elements, but the default distance is too much and the sans-indent is too little. 回答1: <ul style="padding-left:20px"> <li>Element 1</li> <li>Element 2</li> </ul> I think the default indentation is 40px , this halves it. 回答2: li

Filter multiple <ul> lists with jQuery

久未见 提交于 2019-12-03 15:42:10
问题 I have multiple lists on one page (multiple categories of products) like this: <h3>Category 1</h3> <ul id="category1"> <li>item1</li> <li>item2</li> <li>item3</li> </ul> <h3>Category 2</h3> <ul id="category2"> <li>item27</li> <li>item28</li> </ul> The amount of lists is variable. I would like a filter like on the demo page here http://static.railstips.org/orderedlist/demos/quicksilverjs/jquery.html. But it should search over the different lists. If the user searches for "2" then the result

Ordered List Index

别等时光非礼了梦想. 提交于 2019-12-03 15:26:41
Is there any way to get the number (index) of a li tag in an ordered list? I'm trying to get the number that is shown on the side (the list numbering). I know that the traditional way is to use an id which stores the line number but this would mean that if a line is added in between, a lot of ids would have to be edited. Even though I have developed an algorithm for this, it is not so efficient. I'm looking for a solution to use in Javascript. You can use previousElementSibling to jump step-by-step to the beginning of the list and just count how many jumps you made: ol.onclick = function(e) {

Odd “shaking” effect when animating width with jQuery (only in Chrome!)

时光怂恿深爱的人放手 提交于 2019-12-03 13:18:22
I'm animating the width of a li element using jQuery in a simple snippet of code. I'm using hover() as the handler and .animate() to animate the width. Here is my code. $('li').each(function() { //store the original width of the element in a variable var oldWidth = $(this).width(); $(this).hover( function() { //when the mouse enters the element, animate width to 900px $(this).animate({width: '900px'}, 600, 'linear') }, function() { //when the mouse leaves, animate back to the original width $(this).animate({width: oldWidth}, 350, 'linear') } ); }); The code is really really simple and works

li float vs display: inline

穿精又带淫゛_ 提交于 2019-12-03 09:36:47
问题 Is there a best choice out of float: left or display: inline for aligning list items horizontally? eg: http://www.vanseodesign.com/css/simple-navigation-bar-with-css-and-xhtml/ Personally I dislike float , but that maybe more of an emotional thing rather than logical. 回答1: ul { list-style-type: none; overflow: hidden; width:200px; } ul li { float:left; width: 100px; } ul li a { display: block; padding: 10px; width:80px; } ul li a:hover { background: black; } <ul> <li><a href="http://www

Bullets center with unordered list

不羁的心 提交于 2019-12-03 09:18:48
问题 Does anyone know the CSS that makes the bullet point sit at the top of a multi-line bulleted list? For some reason with the template that I am using the bullet point centers to the left instead of simply sitting next to the first word if I have more than one line of text. 回答1: Set the list style position to inside the list item, see this demo fiddle . CSS: ul { list-style-position: inside; } 回答2: This is not an answer per-se but it may give others an insight to a similar visual situation with