Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the bottom border of a box with CSS

Tags:

css

border

alt text

I have a rectangular div, like the one above. I want to remove the bottom border (from C to D) in my div. How can I do this?.

Edit: Here is my CSS:

#index-03 {    position: absolute;    border: .1px solid #900;    border-width: .1px;    border-style: solid;    border-color: #900;    left: 0px;    top: 102px;    width: 900px;    height: 27px;  }
<div id="index-03"        style="background-color:limegreen; width:300px; height:75px;">  </div>
like image 297
Gandalf Avatar asked Nov 06 '10 18:11

Gandalf


People also ask

How do I remove the border of a box in CSS?

We can specify the no border property using CSS border: none, border-width : 0, border : 0 properties. Approach 1: We will give border-color, border-style properties to both headings, for showing text with border and no-border. For no border heading, we will use the border-width : 0 which will result in no border.

Which CSS property is correct for the border bottom?

The border-bottom shorthand CSS property sets an element's bottom border. It sets the values of border-bottom-width , border-bottom-style and border-bottom-color .


2 Answers

Just add in: border-bottom: none;

#index-03 {     position:absolute;     border: .1px solid #900;     border-bottom: none;     left:0px;     top:102px;     width:900px;     height:27px; } 
like image 140
DaiYoukai Avatar answered Oct 24 '22 06:10

DaiYoukai


You can either set

border-bottom: none; 

or

border-bottom: 0; 

One sets the border-style to none.
One sets the border-width to 0px.

div {    border: 3px solid #900;      background-color: limegreen;     width:  28vw;    height: 10vw;    margin:  1vw;    text-align: center;    float: left;  }    .stylenone {    border-bottom: none;  }  .widthzero {    border-bottom: 0;  }
<div>  (full border)  </div>  <div class="stylenone">  (style)<br><br>    border-bottom: none;  </div>  <div class="widthzero">  (width)<br><br>  border-bottom: 0;  </div>

Side Note:
If you ever have to track down why a border is not showing when you expect it to, It is also good to know that either of these could be the culprit. Also verify the border-color is not the same as the background-color.

like image 45
SherylHohman Avatar answered Oct 24 '22 06:10

SherylHohman