html-lists

HTML / CSS : Reset List Padding to Default

房东的猫 提交于 2019-12-08 14:45:56
问题 I'm using *{margin:0; padding:0;} and this is the first time that it breaks me in something. List paddings and margins are 0 too, so the indentation is lost. and I would like to reset them to their original state, how is this possible? I've tried this with no success: ul,ol{ margin :auto; /* This Works */ padding:auto; /* This Not :( */ } So how should I fix this? 回答1: The point of a reset is to eliminate variations due to browser defaults. In other words, there is no definitive way to

How do I recursively assign each item in a list an unique ID?

ⅰ亾dé卋堺 提交于 2019-12-08 13:43:07
问题 I have the following list. <ol> <li> <a href="client.htm">Client</a> <ol> <li><a href="client/nokia.htm">Nokia</a></li> <li><a href="client/microsoft.htm">Microsoft</a></li> <li><a href="client/sony.htm">Sony</a></li> <li><a href="client/samsung.htm">Samsung</a></li> </ol> </li> <li><a href="contact.htm">Contact</a></li> </ol> That I would like to transform into something similar to this. <ol> <li> <a id="sitemap-item-1" href="client.htm">Client</a> <ol> <li><a id="sitemap-item-1-1" href=

CSS center ul list inside a 100% width div

谁说胖子不能爱 提交于 2019-12-08 10:15:49
问题 I feel as if I have tried everything from text-align center to margin:0 auto with a position relative and width of 100%, but they didn't work, I am trying to center my UL inside the div... Here is my code <style type="text/css"> .header { height: 40px; background: #000; width: 100%; } .header ul { list-style-type: none; } .header li { float: left; line-height: 40px; } .header li a { color: #FFF; padding: 0 18px; height: 40px; } </style> <div class="header"> <ul> <li><a href="#">Home</a></li>

Localstorage: If the ID of a <li> exists in localstorage alert

家住魔仙堡 提交于 2019-12-08 10:04:51
问题 I want to check if the ID of a <li> exists in localstorage to alert... For example, the li's have id such as item-1, item-2, item-3 etc. In localstorage there is a value named id and it gets a string with the same name: item-1, item-2, item-3. I want to check, when I click on a li with id item-2, if that item-2 exists in localstorage to alert accordingly. This is my HTML: <ul id="bxs" class="tabs"> <li id="item-1">1</li> <li id="item-2">2</li> <li id="item-3">3</li> <li id="item-4">4</li> <li

height: auto does not work on <li> elements

只谈情不闲聊 提交于 2019-12-08 07:38:51
问题 I've been trying to fix this layout problem for an hour or so with no luck. I simply want my li to expand to match the height of its contents, so that margin-bottom will work correctly. Here's my code (note: this is just a draft, so the relevant CSS is mixed in via style attributes): <!-- This uses ASP.NET markup syntax but should still be legible to anyone --> <h2>Related</h2> <ul class="list-unstyled owner-list"> @foreach (var package in Model.RecommendedPackages) { <li style="position:

Increasing font size without moving other text

蓝咒 提交于 2019-12-08 07:22:57
问题 I'm learning HTML and CSS, I have searched this question but I didn't find a solution which worked for me. So in my navigation bar, when the user hovers their mouse over a piece of text the size increases but also moves the other pieces of text. I want the size to increase but not move the other pieces of text. MY WEBSITE .nav { margin-top: 0px; height: 40px; width: 600px; background: white; } .nav ul { display: inline-block; margin: 0; padding: 0; } .nav ul li { list-style: none; display:

How to vertically center anchor tag text inside of a ul li

放肆的年华 提交于 2019-12-08 05:04:39
问题 Here is my html: <ul id="sub_nav" class="block_hide trim no_list no_line" style="display: block; left: 524.5px;"> <li><a href="/path1" class="one">1st button</a></li> <li><a href="/path2" class="one">2nd button</a></li> <li><a href="/path3" class="one">3rd button</a></li> </ul> I also attached an image if what I currently have. I tried adding display: table-cell; vertical-align: middle; to the anchor tag class but it did not work I also tried adding a span around teh anchor tag with a class

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

自作多情 提交于 2019-12-08 02:25:59
问题 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

itext XMLWorkerHelper ignores value attribute of <li> tag

怎甘沉沦 提交于 2019-12-08 01:55:09
问题 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

Emmet overwritten snippet

喜夏-厌秋 提交于 2019-12-07 22:58:02
问题 I have been following the lessons on HTML and CSS provided by Jeffery Way on Tuts+: http://learncss.tutsplus.com/ I got to the video on Zen Coding: http://learncss.tutsplus.com/lesson/zen-coding/ I tried installing Zen Code to Sublime Text 2 but couldn't get it to work. I looked around on the web and found Emmet, which seemed like the new best thing. So I installed through the Command Pallete>"Package Install">"Emmet". It works great, the only issue is a snippet I used before is overwritten