简体   繁体   English

在HTML和CSS中仅获取底部边框

[英]Getting only border-bottom in HTML and CSS

I wanted only border-bottom line, not border-left, border-right or border-top: 我只需要边框底线,而不需要边框左,边框右或边框顶:
So I wrote a code like this: 所以我写了这样的代码:
CSS code and HTML code : CSS codeHTML code

 .category { border-radius: 4px; border: 1px solid blue; height: 33px; margin: 2% 0; padding: 1% 2%; width: 100%; border-bottom: lined; border-bottom-color: blue; } 
 <div class = "category"> <span class = "ctgryName" id="ctgryName">JNCIA - Junos</span> <!-- <span class = "ctgryIcon pull-right"></span> --> </div> 

But I'm getting a whole border, I want only border-bottom line. 但是我得到了整个边框,我只想要边框底线。
How can I do it? 我该怎么做?

Your mistake is that you set the border instead of border-bottom , please do the following- 您的错误是您设置了border而不是border-bottom ,请执行以下操作-

change this css line: 更改此CSS行:

border: 1px solid blue;  

to

border-bottom: 1px solid blue;

You can select wich border you want to display like this : 您可以选择要显示的边界,如下所示:

border:0;
border-bottom:1px solid blue;

try this code.. u made mistake in css you have used border also and border-bottom also. 试试这个代码..你在css中弄错了,你也使用border和border-bottom。 u need to use only border-bottom 您只需要使用边界底

   .category {
   border-radius: 4px;
   border-bottom: 1px solid blue;
   height: 33px;
   margin: 2% 0;
   padding: 1% 2%;
   width: 100%;

    }  

change 更改

border: 1px solid bleu;

to

 border-bottom: 1px solid blue;

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

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