Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I show only corner borders?

I'm wondering if it's possible in CSS to make a border but only for corner. Something like this:

****                         **** *                               * *                               *               CONTENT  *                               * *                               * ****                         **** 
like image 715
pierreaurelemartin Avatar asked Jan 17 '13 20:01

pierreaurelemartin


People also ask

How do you make a invisible border?

To make an invisible border, set the BORDER attribute to 0. (Although most browsers default to a table border of 0, specifically stating it ensures that the border will be invisible in all browsers.)

How do you display border in HTML?

Using Inline Style attribute Step 1: Firstly, we have to type the Html code in any text editor or open the existing Html file in the text editor in which we want to use the inline property for adding the border. Step 2: Now, place the cursor inside the opening tag of that text around which we want to add the border.


1 Answers

Assuming <div id="content">CONTENT</div> and that CONTENT includes at least one HTML node.

#content {position:relative} #content:before, #content:after, #content>:first-child:before, #content>:first-child:after {     position:absolute; content:' ';     width:80px; height: 80px;     border-color:red; /* or whatever colour */     border-style:solid; /* or whatever style */ } #content:before {top:0;left:0;border-width: 1px 0 0 1px} #content:after {top:0;right:0;border-width: 1px 1px 0 0} #content>:first-child:before {bottom:0;right:0;border-width: 0 1px 1px 0} #content>:first-child:after {bottom:0;left:0;border-width: 0 0 1px 1px} 

Here's a Fiddle

like image 149
Niet the Dark Absol Avatar answered Sep 22 '22 20:09

Niet the Dark Absol