Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I create border-bottom without diagonal corner? [duplicate]

I want to create a box with different color, left,right and top color red and bottom color is grey but I want flat bottom-border of box

HTML

<div class="ts"></div>

CSS

.ts {    
    height:100px;
    width:100px;
    border-width:10px 10px 20px 10px;
    border-style:solid;
    border-color:#f00 #f00 #ddd #f00;
}

When I create it with above code, It seems like this

enter image description here

But I don't want bottom-border as diagonal corner, I want it as;

enter image description here

http://jsfiddle.net/3jHG8/

Is there an easy way to do it as crossbrowser?

like image 791
midstack Avatar asked Mar 20 '14 13:03

midstack


People also ask

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 .

Which of the following property changes the style of bottom border?

The border-bottom-color property sets the color of an element's bottom border. Note: Always declare the border-style or the border-bottom-style property before the border-bottom-color property.


1 Answers

Just use css box-shadow as follow:

JSFIDDLE DEMO 1

HTML

<div class="ts"></div>

CSS

.ts {    
    height:100px;
    width:100px;
    border-width:10px 10px 0px 10px;
    border-style:solid;
    border-color:#f00 #f00 transparent #f00;
    box-shadow: 0 20px 0 #ddd;
}

enter image description here

or box-shadow only:

.ts {
height: 100px;
width: 100px;
box-shadow: inset 0 10px 0 0 #f00,inset 10px 0 0 0 #f00,inset -10px 0 0 0 #f00, 0 20px 0 #ddd;
}

JSFIDDLE DEMO 2

enter image description here

Use CSS3 PIE, to emulates some text-shadow in older versions of in IE7 and IE8.

like image 68
Gildas.Tambo Avatar answered Sep 30 '22 02:09

Gildas.Tambo