简体   繁体   English

无法在DT上创建border-radius

[英]Can't make border-radius on DT

Why can't I make a border-radius on my <dt> ? 为什么我不能在<dt>上创建border-radius

http://thistedbolig.konggulerodhosting.dk/ http://thistedbolig.konggulerodhosting.dk/

What can I change? 我能改变什么? I really need to make the border-radius. 我真的需要制作border-radius。 I have tried many things, but none of them work. 我尝试了很多东西,但没有一个能奏效。 I hope someone here can help me so I can finish the project. 我希望有人可以帮助我,这样我就能完成这个项目。

CSS: CSS:

.dropdown dt { border-radius: 10px 0px 0px 10px;}

HTML: HTML:

        <div class="small-6 medium-3 columns">
          <dl class="dropdown">

            <dt>
            <a href="#0">
              <span title="city" class="hida " ><img src="assets/images/search/placeholder.svg" alt="" style="width:20px; height:20px; margin-right:10px;">Vælg en by</span>
              <p class="multiSel"></p>
            </a>
            </dt>

            <dd>
                <div class="mutliSelect">
                    <ul>
                        <li>
                            <input type="checkbox" value="Thisted" />Thisted</li>
                        <li>
                            <input type="checkbox" value="Snested" />Snested</li>
                        <li>
                            <input type="checkbox" value="Vesløs" />Vesløs</li>
                        <li>
                            <input type="checkbox" value="Nors" />Nors</li>
                        <li>
                            <input type="checkbox" value="Sennels" />Sennels</li>
                        <li>
                            <input type="checkbox" value="Østerild" />Østerild</li>
                    </ul>
                </div>
            </dd>
        </dl>
        </div>

You need to set the border on the a tag in order to apply a border 您需要在标签上设置边框才能应用边框

Thus: 从而:

Update: 更新:

.dropdown dt { 
              height: 20px;
              line-height: 20px;
              display: block;
              background: black;
}


.dropdown dt a {
    padding: 8px 20px 5px 10px;
    overflow: hidden;
    border-radius: 10px 0px 0px 10px;
}

should work! 应该管用!

line-height will center the text vertically! line-height将文本垂直居中!

Check this jsfiddle: https://jsfiddle.net/9tgj0n5k/1/ 检查这个jsfiddle: https ://jsfiddle.net/9tgj0n5k/1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM