无序列表帮助!需要一个解决方案

时间:2016-07-20 10:12:44

标签: html css html-lists

如何在li之前删除项目符号和额外空格。

this (image of the issue)

我尝试了list-style: none,但这只是删除了子弹,剩下的额外空间仍然存在。这是jsFiddle

我想要这样的东西。

this (image of expected result)

5 个答案:

答案 0 :(得分:0)

只需添加padding-left 0 for(.price-bg ul)

答案 1 :(得分:0)

ul标记采用浏览器给出的默认填充,因此您必须将其删除。添加padding:0px



/* --------------------------------------
   Pricing & Plans
   -------------------------------------- */

.pricing-title {
    color: #272727;
    text-align: center;
    padding: 15px;
    font-family: 'myriadbold';
    border-bottom: 2px solid #ededed;
}

.pricing-price {
    color: #4f4f4f;
    text-align: center;
    font-size: 80px;
    margin-bottom: 20px;
}

.pricing-yr {
    font-size: 20px;
    font-family: 'myriadsemibold';
}

.price-bg ul {
    list-style-type: none;
    position: relative;
    left: 0px;
    border-top: 1px solid #eaeaea;
    padding:0px;
}

.price-bg ul li {
    position: relative;
    padding: 16px 5px 16px 70px;
    border-bottom: 1px solid #eaeaea;
}

.price-bg ul li:before {
    font-family:  "fontawesome";
    content: "\f00d";
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    position: absolute;
    top: 50%;
    left: 0;
    width: 52px;
    font-size: 12px;
    color: #ef662f;
    text-align: center;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
}

.price-bg ul li.tick:before {
    font-family:  "fontawesome";
    content: '\f00c';
    color: #7ab55c;
}

.price-bg ul li:after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 52px;
    bottom: 0;
    width: 1px;
    background: #eaeaea;
}

.price-bg {
    background-color: white;
    border-radius: 7px;
    width: 100%;
    border: 1px solid #eaeaea;
    -webkit-box-shadow: 0px 2px 4px 0px rgba(148,148,148,0.4);
    -moz-box-shadow: 0px 2px 4px 0px rgba(148,148,148,0.4);
    box-shadow: 0px 2px 4px 0px rgba(148,148,148,0.4);
}

<section class="container">
        <h3>SUBHEADING</h3>
        <h1>Simple Pricing for All</h1>
        <div class="row">
            <div class="col-sm-4">
                <div class="price-bg">
                    <h3 class="pricing-title">BASIC PACKAGE</h3>
                    <h1 class="pricing-price">£150<span class="pricing-yr">yr</span></h1>
                    <ul>
                        <li class="tick">3x iBeacons<span>+ £30 for additional iBeacon</span></li>
                    </ul>
                    <p>APP FEATURES</p>
                    <ul>
                        <li class="tick">Smart Quiz</li>
                        <li>Educational Tasks</li>
                        <li>Interactive Gallery Game</li>
                        <li>Brand Customisation</li>
                        <li>Removed Watermark</li>
                    </ul>
                    <p>PACKAGE SUPPORT</p>
                    <ul>
                        <li>All Future Features/Content<span>+ exclusive content</span</li>
                        <li class="tick">Unlimited, free 24 hour support</li>
                        <li class="tick">Unlimited Users</li>
                        <li class="tick">Free Maintenance</li>
                        <li class="tick">No setup fees</li>
                    </ul>
                    <p>EXTRA ADD-ONS (OPTIONAL)</p>
                    <ul>
                        <li>Step by Step Videos</li>
                        <li>Content Request<span>(Our team will update the apps
content for you)</span></li>
                        <li>Workshop<span>+ step by step videos</span></li>
                    </ul>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="price-bg">
                    
                </div>
            </div>
            <div class="col-sm-4">
                <div class="price-bg">
                    
                </div>
            </div>
        </div>
    </section>
&#13;
&#13;
&#13;

答案 2 :(得分:0)

padding-left: 0px;添加到.price-bg ul

答案 3 :(得分:0)

这是因为列表项的默认边距和填充。

marginpadding重置为0上的.price-bg ul。这是updated fiddle

.price-bg ul {
    list-style: none;
    position: relative;
    left: 0px;
    margin: 0;
    padding: 0;
    border-top: 1px solid #eaeaea;
}

答案 4 :(得分:0)

添加其他答案,如果您使用的是bootstrap,则可以添加class:

class="list-unstyled"

致UL。