html-lists

Center unordered list in DIV

余生颓废 提交于 2019-12-03 09:00:36
问题 First of all, I know this question has been asked a MILLION times...and I've looked at this one specifically as well as several others on this site and other sites. I've tried a ton of different variations on each of these and still can't get it to work. I'm trying to center an unordered list. It displays correctly, it's just not centered. At the moment, it's CLOSE to center...but if you change the "width" parameter in the .nav-container code in the CSS then it shifts the position of the div.

JQuery Mobile - Display An HTML Form Inline

大憨熊 提交于 2019-12-03 07:11:41
Goal: Display textbox and submit button on the same line in Jquery Mobile. Problem: They will not display on the same line. I've tried many times to display the textbox and submit button on the same line, but it never works. Here is my code and the combinations I used... <form method="GET" style="display: inline-block;"> <input type="text" name="id" value="Other"> <input type="submit" data-type="button" data-icon="plus" value="Add"> </form> That did not work. <form method="GET"> <span> <input type="text" name="id" value="Other"> <input type="submit" data-type="button" data-icon="plus" value=

Can you count a particular class with CSS?

蓝咒 提交于 2019-12-03 06:33:56
问题 Lets say I have a simple list like so: <ol> <li class="count">one</li> <li class="count">two</li> <li class="count">three</li> <li class="count">four</li> <li>blabla</li> <li class="count">five</li> <li class="count">six</li> <li>blabla</li> <li class="count">seven</li> </ol> Now I only want to number list items with the class 'count' So If I add the CSS: li { list-style-type: decimal; } and then remove the list-style-type for list items without the class: li:not(.count) { list-style-type:

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

别等时光非礼了梦想. 提交于 2019-12-03 06:33:45
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:block; position:relative; margin-left:1em; } #main-menu > ul > li.first{ margin-left:0; } /* sub Main

bulleted list with different indentation

二次信任 提交于 2019-12-03 06:11:38
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. <ul style="padding-left:20px"> <li>Element 1</li> <li>Element 2</li> </ul> I think the default indentation is 40px , this halves it. ebaum li { margin-left: 10px; } ul li{ margin-left: 20px; } A slightly cleaner way to adjust both of the

How to get rid of white space between css horizontal list items? [duplicate]

你离开我真会死。 提交于 2019-12-03 05:40:10
问题 This question already has answers here : Why is there an unexplainable gap between these inline-block div elements? (6 answers) How do I remove the space between inline-block elements? (39 answers) Closed 5 years ago . I've got the following test page and css. When displayed, there is a 4px gap between each list item. How do I get the items to be next to each other? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> <link type=

Angular2 UL/LI JSON-tree recursive in ngFor

时间秒杀一切 提交于 2019-12-03 04:52:31
问题 I'd like to convert JSON-trees into unordered lists in Angular2. I know the recursive directive solution from Angular1 and I am pretty sure the solution in Angular2 will be recursive too. [ {name:"parent1", subnodes:[]}, {name:"parent2", subnodes:[ {name:"parent2_child1", subnodes:[]} ], {name:"parent3", subnodes:[ {name:"parent3_child1", subnodes:[ {name:"parent3_child1_child1", subnodes:[]} ] } ] } ] to this unordered list <ul> <li>parent1</li> <li>parent2 <ul> <li>parent2_child1</li> </ul>

onclick event pass <li> id or value

≡放荡痞女 提交于 2019-12-03 04:46:05
I want to pass <li> id or value in onclick event. here is my exiting code. <li onclick="getPaging(this.value)" id="1" value="1">1</li> <li onclick="getPaging(this.value)" id="2" value="2">2</li> here is the javascript code function getPaging(str) { $("#loading-content").load("dataSearch.php?"+str, hideLoader); } Anish Try like this... <script> function getPaging(str) { $("#loading-content").load("dataSearch.php?"+str, hideLoader); } </script> <li onclick="getPaging(this.id)" id="1">1</li> <li onclick="getPaging(this.id)" id="2">2</li> or unobtrusively $(function() { $("li").on("click",function

Getting rid of bullet points from <ul>

本秂侑毒 提交于 2019-12-03 03:13:45
问题 I have the following list: <ul id="otis"> <li>Benz</li> <li>Other Benz</li> <li>Other Other Benz</li> </ul> I want to get rid the bullets so i tried: ul#otis { list-style-type: none; } That didn't work though. What is the proper way to remove the bullets from the displayed list? 回答1: Assuming that didn't work, you might want to combine the id -based selector with the li in order to apply the css to the li elements: #otis li { list-style-type: none; } Reference: list-style-type at the Mozilla

CSS list-style-type not working

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 01:45:46
I have set the list-style-type in CSS, but for some reason it's not showing it. body { margin: 0; } ol { list-style-type: decimal; padding-left: 0; } <ol> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ol> Because of your padding reset, the numbers are actually off to the left of the page. Try adding: list-style-position: inside; display:list-item; list-style-position:outside; It may give problem if list display: attribute is set to some thing else than display:list-item; Decimal is default for an "ol". No need to declare it. Also the numbers are there just falling off the side of the page