Html unordered 不会删除使用类 unstyled 的样式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17002128/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 09:14:51  来源:igfitidea点击:

unordered is not removing the style on using class unstyled

htmlcsstwitter-bootstrap

提问by Ritesh Mehandiratta

i am a beginner in Bootstrap .i am trying to unstyle the list using unstyled class,but it is not removing black-spot on the left most of each option how to remove this black dot please guideline my code is

我是 Bootstrap 的初学者。我正在尝试使用 unstyled 类取消列表的样式,但它并没有删除每个选项左侧大部分的黑点如何删除这个黑点请指导我的代码是

<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  </head>

<body>
<script src="http://code.jquery.com/jquery.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
<ul class="unstyled">
<li>
  <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>Option 1
</li>
<li>
  <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">Option 2 
</li>
<li><input type="radio" name="optionsRadios" id="optionsRadios3" value="option3">option3</li>
<li><input type="radio" name="optionsRadios" id="optionsRadios4" value="option4">option4</li>
<li><input type="radio" name="optionsRadios" id="optionsRadios5" value="option5">option5</li>
</ul>
</body>
</html>

enter image description here

在此处输入图片说明

回答by dsgriffin

Bootstrap 3+

引导程序 3+

As of Bootstrap 3, you'd use the list-unstyledclass to achieve this.

从 Bootstrap 3 开始,您将使用list-unstyled该类来实现这一点。

Unstyled- Remove the default list-styleand left-marginon list items (immediate children only). This only applies to immediate children list items, meaning you will need to add the class for any nested lists as well.

Unstyled- 删除默认list-styleleft-margin列表项(仅限直接子项)。这仅适用于直接子列表项,这意味着您还需要为任何嵌套列表添加类。

Example:

例子:

<ul class="list-unstyled">
  <li>...</li>
</ul>


Bootstrap 2

引导程序 2

If still using Bootstrap 2, you'd use the unstyledclass.

如果仍在使用 Bootstrap 2,您将使用unstyled该类。

Unstyled- Remove the default list-styleand left paddingon list items (immediate children only).

Unstyled- 删除默认list-styleleft padding列表项(仅限直接子项)。

Example:

例子:

<ul class="unstyled">
  <li>...</li>
</ul>

回答by Zubair Alam

first link your bootstrap.css in your html file. you can search for "list-unstyled" class in bootstrap.css file. bootstrap current version is 3.0.0, so you can remove style from ul this way:

首先将您的 bootstrap.css 链接到您的 html 文件中。您可以在 bootstrap.css 文件中搜索“list-unstyled”类。bootstrap 当前版本是 3.0.0,因此您可以通过以下方式从 ul 中删除样式:

<ul class="list-unstyled">
<li>
  <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1"     checked>Option 1
</li>
</ul>