【问题标题】:How can I get rid of Dots from <ul> in <nav> [duplicate]如何从 <nav> 中的 <ul> 中删除 Dots [重复]
【发布时间】:2014-12-14 20:55:38
【问题描述】:

这是我的网站在 Firefox 中的样子(注意点)。

这是它在 Chrome 中的外观(无点)。

有没有办法让这些点消失?

这是我的代码:

function changeText(button) {
    button.innerHTML = 'Get Started';
}
.bcafrees {
    text-align: center;
    font-family:'Roboto', sans-serif;
    color: #FFFFFF;
    text-align: center;
    font-size: 60px;
    margin-bottom: 1%;
    text-shadow: 1px 1px #000000;
}

nav.header {
    margin: 0;
    background-color: #66C2FF;
}

nav ul {
    width: 100%;
    margin: 0;
    padding: 0;
    height: 4%
}

nav ul li {
    width: 4%;
    float: left;
    margin: 0% 1% 2% 2%;
    vertical-align: middle;
    text-align: center;
    align-items: center;
    height: 10px;
    margin-top: 0%;
    padding-top: 0%;
}

nav ul li a {
    display: block;
    width: 100%;
    text-align: center;
    color: #FFFFFF;
    text-decoration: none;
    font-family: 'Lato', sans-serif;
    font-size: 22px;
    vertical-align: middle;
}

nav ul li a:hover {
    color: #859999;
}

body {
    background-color: #3A75B0;
    width: 100%;
    max-width: 1000000px;
    margin: 0 auto !important;
}

body p {
    color: #FFFFFF;
    text-align: center;
    font-family: 'Raleway', sans-serif;
    font-size:50px;
    padding-top: 10px;
    padding-bottom: 5px;
    margin: 0;
    border: 0;
}

.getStarted {
    display: table;
    margin: 0 auto !important;
    height: 170px;
    width: 300px;
    background: transparent;
    text-decoration: none;
    border-style: solid;
    border-color: #FFFFFF;
    font-family: Helvetica;
    text-align: center;
    color: #FFFFFF;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    font-size: 60px;
    padding: 20px 10px 50px 10px;
    margin-bottom: 50px;
    font-family: 'Raleway', sans-serif;
}

.getStarted a {
    text-decoration: none;
    font-family: 'Raleway', sans-serif;
    text-align: center;
    color: #FFFFFF;
    font-size: 60px;
    margin-bottom: 50px;
}

a:link {
    text-decoration: none;
}

a:visited {
    text-decoration: none;
}

footer {
    clear: both
    color: #FFFFFF;
    font-family: TW Cen MT;
    padding-top: 5.06%;
    position: relative;
    
}

footer ul {
    width: 100%;
    list-style: none;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    overflow: hidden;
    text-align: center;
    display: block;
    color: #FFFFFF;
    text-decoration: none;
    font-family: TW Cen MT;
}

footer div {
    background-color: #66C2FF;
    height: 100px;
    text-decoration: none;
}

.timmy:hover {
    color: #3A75B0;  
}

.katie:hover {
    color: #3A75B0;
}

.katie {
    display: table;
    margin-left: auto;
    margin-right: auto;
    width: 70px;
}

.timmy {
    display: table;
    margin-left: auto;
    margin-right: auto;
    width: 95px;
}

footer div ul a{
    width: 100px;
}

hr {
    margin-top: 10px;
    color: #FFFFFF;
    width: 70%;
}

.getStartedButton:hover {
    color: #3A75B0;
    background-color: #FFFFFF;
}

.getStartedButton {
    width: 300px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 10px;
}

.getStartedButton a:hover {
    color: #3A75B0;
}

.getStarted:hover {
    color: #3A75B0;
}

.getStartedButton.getStarted:hover {
    color: #3A75B0;
}
<html lang="en">
    <head>
        <meta charset="utf-8">
        <link type="text/css" rel="stylesheet" href="welcome.css"/>
        <link href='http://fonts.googleapis.com/css?family=Raleway:100' rel='stylesheet' type='text/css'>
        <link href='http://fonts.googleapis.com/css?family=Roboto:100' rel='stylesheet' type='text/css'>
        <link href='http://fonts.googleapis.com/css?family=Lato:300' rel='stylesheet' type='text/css'>
        <script type="text/javascript" src="Welcome.js"></script>
        <title>BCA Frees</title>
    </head>
    <body>
        <header>
            <div class="bcafrees">
                BCA Frees
            </div>
            <nav class="header">
                <ul>
                    <li></li>
                    <li></li>
                    <li class="home"><a href ="www.bcafrees.com/">Home</a></li>
                    <li></li>
                    <li></li>
                    <li class="about"><a href ="www.bcafrees.com/about">About</a></li>
                    <li></li>
                    <li></li>
                    <li class="faqs"><a href ="www.bcafrees.com/faqs">FAQs</a></li>
                    <li></li>
                    <li></li>
                    <li class="credits"><a href ="www.bcafrees.com/credits">Credits</a></li>
                    <li></li>
                    <li></li>
                </ul>
            </nav>
        </header>
        <div id="wrapper">
            <div class="p">
                <p>Find Your Friends</p>
                <p>During Your Frees</p>
                <hr />
                <br />
            </div>
            <div class="getStartedButton">
                <a href ="/signup">
                    <button onmouseover="changeText(this)" class="getStarted">
                    Get Started
                    </button>
                </a>
            </div>
        </div>
        <footer>
            <div id="footer">
                <ul>
                    <li>Copyright BCA Frees 2014</li>
                    <hr class="hr" />
                    <li>Created By:</li>
                    <li class="timmy">Timothy Obiso</li>
                    <li class="katie">Katie Katz</li>
                </ul>
            </div>
        </footer>
    </body>
</html>

【问题讨论】:

  • 你有没有尝试过任何东西——例如。查找liul css 样式?

标签: javascript html css google-chrome firefox


【解决方案1】:

nav ul li 选择器中添加list-style: none;

nav ul li {
    list-style: none;
    width: 4%;
    float: left;
    margin: 0% 1% 2% 2%;
    vertical-align: middle;
    text-align: center;
    align-items: center;
    height: 10px;
    margin-top: 0%;
    padding-top: 0%;
}

【讨论】:

    【解决方案2】:

    要从列表中删除项目符号或数字,您可以使用list-style: none;。还值得注意的是,您可能希望删除为列表自动创建的默认 padding

    HTML

    <ul>
        <li>Item One</li>
        <li>Item Two</li>
        <li>Item Three</li>
    </ul>
    
    <ol>
        <li>Item One</li>
        <li>Item Two</li>
        <li>Item Three</li>
    </ol>
    

    CSS

    ol, ul {
        list-style: none;
        padding: 0; /* Optional to remove default padding */
    }
    

    一个例子可以看jsFiddle:http://jsfiddle.net/jamesjefferyUK/p26afsp1/1/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-22
      • 2016-07-20
      • 2015-05-23
      • 1970-01-01
      • 2014-12-06
      • 2014-10-29
      • 1970-01-01
      • 2019-12-08
      相关资源
      最近更新 更多