html-lists

Make whole <li> as link with proper HTML

戏子无情 提交于 2019-12-04 08:06:43
问题 I know this has been up a lot of times before, but I couldn't find any solution in my specific case. I've got a navigation bar and I want the whole <li> 's to be "linked" or "clickable" if you will. Now only the <a> (and the <div> 's I've fiddled with) is "clickable". I've tried the li a {display: inner-block; height: 100%; width: 100%} method but the results where just horrible. The source can be found here: http://jsfiddle.net/prplxr/BrcZK/ HTML <!DOCTYPE html> <html> <head> <title>asdf<

Dropdown list alignment issue (HTML/CSS)

非 Y 不嫁゛ 提交于 2019-12-04 06:57:27
问题 I've asked a question like this before, but I am using differnt code to last time. I'm trying to create a dropdown menu. Ther are certain elements in that main list that have a dropdown list (News and Team). For some reason, they are moved over to the right. What I would like is for the items in the dropdown to be aligned with its parent. Any help would be appreciated. Thanks http://codepen.io/DocRow10/pen/hjIkq <body> <div id="container"> <div id="banner" class="clearfix"> <img id="crest"

Why won't my list align horizontally center

瘦欲@ 提交于 2019-12-04 06:45:17
问题 I'm working on a basic nav bar project, and I've trying to get this list to align center. I've tried using align-content and text-align , but my bar is still positioned towards to the left. Can you please show me how to center this list horizontally? li1 li2 li3 (should be centered by css not spaces, of course) Here is a Demo @import url(http://fonts.googleapis.com/css?family=Quicksand:300); #bannercontent { font-family: 'Quicksand:300'; align-items: center; text-align: center; align-content:

PHP Multidimensional array to unordered list, building up url path

耗尽温柔 提交于 2019-12-04 05:28:37
I have a multidimensional array in PHP produced by the great examples of icio and ftrotter (I am use ftrotterrs array in arrays variant): Turn database result into array I have made this into a unordered list width this method: public function outputCategories($categories, $startingLevel = 0) { echo "<ul>\n"; foreach ($categories as $key => $category) { if (count($category['children']) > 0) { echo "<li>{$category['menu_nl']}\n"; $this->outputCategories($category['children'], $link , $start, $startingLevel+1); echo "</li>\n"; } else { echo "<li>{$category['menu_nl']}</li>\n"; } } echo "</ul>\n"

Centering lists in Zurb Foundation

让人想犯罪 __ 提交于 2019-12-04 05:25:44
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></li> </ul> </div> </div> However, when removing the this does work (but obviously is not preferred

How can I hide elements in my list and add a 'show more' feature?

与世无争的帅哥 提交于 2019-12-04 05:25:38
I'm using javascript to build a list of results. I have a for-loop that iterates over some data and creates a mydata div, and adds that to the results div. Let's pretend it looks something like this: <div id="results"> <div class="mydata">data 1</div> <div class="mydata">data 2</div> ... <div class="mydata">data 20</div> </div> What I want to do is only display 5 results at a time , and should the user wish to see more, they can click a show next 5 or show more button (or something similar). Any ideas? Just to clarify, every time the user clicks "show more" I want to 'unhide' the next 5

Displaying List Of JavaScript Objects As HTML List Items

醉酒当歌 提交于 2019-12-04 05:04:33
问题 When I attempt this, the HMTL page only displays the last object, instead of all the objects. Here is my JavaScript file var family = { aaron: { name: 'Aaron', age: 30 }, megan: { name: 'Megan', age: 40 }, aaliyah: { name: 'Aaliyah', age: 2 } } var list = function(family) { for (var prop in family) { var elList = document.getElementById('aaron-family').innerHTML = prop; } } list(family); And here's my HTML file <html> <head> <title>Aaron's Test With Objects</title> </head> <li id="aaron

Can not have an ul inside an ol in html

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 04:58:01
问题 I get the following validation error when I tested my HTML. Please look at the attached image for the HTML code. "Element ul not allowed as child of element ol in this context." 回答1: This is because the content model for <ol> (and <ul> actually) is zero or more li elements These two tags actually can't contain anything other than <li> tags or nothing at all. If you have <ol><ul> browsers will automatically close the <ol> tag before beginning the <ul> (well, the good ones). I think your intent

How can I positioning LI elements to the bottom of UL list

十年热恋 提交于 2019-12-04 03:07:21
问题 I have menu items like: Row1 Row2.. RowN and I want them not to be that wide - that's why including breaks (with max-width) I have this HTML: <div> <ul> <li>Row1</li> <li>Row1 Row2 Row3</li> <li>Row1</li> <li>Row1 Row 2</li> </ul> </div> with this CSS: /* MENU */ .menudiv {padding-left:10px; border-bottom: 1px solid #d0db88;} ul.menu { list-style-type: none; min-width: 1050px; position: relative; left:10px; display: block; height: 45px; margin: 0; padding: 0; } ul.menu li { float: left;

Print hierachical data in a parent child form unordered list php?

孤街醉人 提交于 2019-12-04 02:13:15
问题 I have data in mysql table in a parent child hierarchy like; |---------+-----------+-------------| | msg_id | parent_id | msg | |---------+-----------+-------------| | 1 | NULL | msg1 | | 2 | NULL | msg2 | | 3 | NULL | msg3 | | 4 | 1 | msg1_child1 | | 5 | 1 | msg1_child2 | | 6 | 3 | msg3_child1 | |---------+-----------+-------------| I need to display it in a parent-child unordered list format like -msg1 -msg1-child1 -msg2-child2 -msg2 -msg3 -msg3-child1 How do I do it? I need help especially