CSS Implementation Sharp DIV

Source: Internet
Author: User
Sharp corners on top

Code:


[HTML]
<title> Sharp Corner div</title>
<style type= "Text/css" >
#top
{
width:400px;
height:250px;
BORDER:3PX solid; /* Border Width is 3px */
position:relative;
}
. sp1,.sp2
{
Display:block;
height:0px;
width:0px;
Position:absolute;
font-size:0;
line-height:0;
}
. SP1
{
top:-9px; /* Its absolute value plus span border width is equal to 5 times times the width of the div border */
left:40px; /* It to determine the position of the sharp corner */
border-top:0px;
BORDER-BOTTOM:6PX solid black; /* Notice the change in color */
BORDER-RIGHT:6PX solid white;
BORDER-LEFT:6PX solid white;
}
. SP2
{
top:6px; /* is twice times the width of its own border */
left:-3px; /* is the width of its own border-1 time times */
border-top:0px;
border-bottom:3px solid white;
BORDER-RIGHT:3PX solid black;
BORDER-LEFT:3PX solid black;
}

</style>

<body>
<div id= "Top" >
<span class= "SP1" >
<span class= "SP2" ></span>
</span>
</div>
</body>

<title> Sharp Corner div</title>
<style type= "Text/css" >
#top
{
width:400px;
height:250px;
BORDER:3PX solid; /* Border Width is 3px */
position:relative;
}
. sp1,.sp2
{
Display:block;
height:0px;
width:0px;
Position:absolute;
font-size:0;
line-height:0;
}
. SP1
{
top:-9px; /* Its absolute value plus span border width is equal to 5 times times the width of the div border */
left:40px; /* It to determine the position of the sharp corner */
border-top:0px;
BORDER-BOTTOM:6PX solid black; /* Notice the change in color */
BORDER-RIGHT:6PX solid white;
BORDER-LEFT:6PX solid white;
}
. SP2
{
top:6px; /* is twice times the width of its own border */
left:-3px; /* is the width of its own border-1 time times */
border-top:0px;
border-bottom:3px solid white;
BORDER-RIGHT:3PX solid black;
BORDER-LEFT:3PX solid black;
}

</style>

<body>
<div id= "Top" >
<span class= "SP1" >
<span class= "SP2" ></span>
</span>
</div>
</body>

The sharp corners are below.


Code:


[HTML]
<title> Sharp Corner div</title>
<style type= "Text/css" >
#bottom
{
width:400px;
height:250px;
BORDER:3PX solid; /* Border Width is 3px */
position:relative;
}
. sp1,.sp2
{
Display:block;
height:0px;
width:0px;
Position:absolute;
font-size:0;
line-height:0;
}
. SP1
{
bottom:-9px; /* Its absolute value plus span border width is equal to 5 times times the width of the div border */
left:40px; /* It to determine the position of the sharp corner */
border-bottom:0px;
BORDER-TOP:6PX solid black; /* Notice the change in color */
BORDER-RIGHT:6PX solid white;
BORDER-LEFT:6PX solid white;
}
. SP2
{
bottom:6px; /* is twice times the width of its own border */
left:-3px; /* is the width of its own border-1 time times */
border-bottom:0px;
border-top:3px solid white;
BORDER-RIGHT:3PX solid black;
BORDER-LEFT:3PX solid black;
}

</style>

<body>
<div id= "Bottom" >
<span class= "SP1" >
<span class= "SP2" ></span>
</span>
</div>
</body>

<title> Sharp Corner div</title>
<style type= "Text/css" >
#bottom
{
width:400px;
height:250px;
BORDER:3PX solid; /* Border Width is 3px */
position:relative;
}
. sp1,.sp2
{
Display:block;
height:0px;
width:0px;
Position:absolute;
font-size:0;
line-height:0;
}
. SP1
{
bottom:-9px; /* Its absolute value plus span border width is equal to 5 times times the width of the div border */
left:40px; /* It to determine the position of the sharp corner */
border-bottom:0px;
BORDER-TOP:6PX solid black; /* Notice the change in color */
BORDER-RIGHT:6PX solid white;
BORDER-LEFT:6PX solid white;
}
. SP2
{
bottom:6px; /* is twice times the width of its own border */
left:-3px; /* is the width of its own border-1 time times */
border-bottom:0px;
border-top:3px solid white;
BORDER-RIGHT:3PX solid black;
BORDER-LEFT:3PX solid black;
}

</style>

<body>
<div id= "Bottom" >
<span class= "SP1" >
<span class= "SP2" ></span>
</span>
</div>
</body>

Sharp Corner on the left

Code:


[HTML]
<title> Sharp Corner div</title>
<style type= "Text/css" >
#left
{
width:400px;
height:250px;
BORDER:3PX solid; /* Border Width is 3px */
position:relative;
}
. sp1,.sp2
{
Display:block;
height:0px;
width:0px;
Position:absolute;
font-size:0;
line-height:0;
}
. SP1
{
left:-9px; /* Its absolute value plus span border width is equal to 5 times times the width of the div border */
top:40px; /* It to determine the position of the sharp corner */
border-left:0px;
BORDER-TOP:6PX solid white; /* Notice the change in color */
BORDER-RIGHT:6PX solid black;
BORDER-BOTTOM:6PX solid white;
}
. SP2
{
left:6px; /* is twice times the width of its own border */
top:-3px; /* is the width of its own border-1 time times */
border-left:0px;
BORDER-TOP:3PX solid black;
border-right:3px solid white;
BORDER-BOTTOM:3PX solid black;
}

</style>

<body>
<div id= "Left" >
<span class= "SP1" >
<span class= "SP2" ></span>
</span>
</div>
</body>

<title> Sharp Corner div</title>
<style type= "Text/css" >
#left
{
width:400px;
height:250px;
BORDER:3PX solid; /* Border Width is 3px */
position:relative;
}
. sp1,.sp2
{
Display:block;
height:0px;
width:0px;
Position:absolute;
font-size:0;
line-height:0;
}
. SP1
{
left:-9px; /* Its absolute value plus span border width is equal to 5 times times the width of the div border */
top:40px; /* It to determine the position of the sharp corner */
border-left:0px;
BORDER-TOP:6PX solid white; /* Notice the change in color */
BORDER-RIGHT:6PX solid black;
BORDER-BOTTOM:6PX solid white;
}
. SP2
{
left:6px; /* is twice times the width of its own border */
top:-3px; /* is the width of its own border-1 time times */
border-left:0px;
BORDER-TOP:3PX solid black;
border-right:3px solid white;
BORDER-BOTTOM:3PX solid black;
}

</style>

<body>
<div id= "Left" >
<span class= "SP1" >
<span class= "SP2" ></span>
</span>
</div>
</body>

Sharp Corner on the right

Code:


[HTML]
<title> Sharp Corner div</title>
<style type= "Text/css" >
#right
{
width:400px;
height:250px;
BORDER:3PX solid; /* Border Width is 3px */
position:relative;
}
. sp1,.sp2
{
Display:block;
height:0px;
width:0px;
Position:absolute;
font-size:0;
line-height:0;
}
. SP1
{
right:-9px; /* Its absolute value plus span border width is equal to 5 times times the width of the div border */
top:40px; /* It to determine the position of the sharp corner */
border-right:0px;
BORDER-TOP:6PX solid white; /* Notice the change in color */
BORDER-BOTTOM:6PX solid white;
BORDER-LEFT:6PX solid black;
}
. SP2
{
right:6px; /* is twice times the width of its own border */
top:-3px; /* is the width of its own border-1 time times */
border-right:0px;
BORDER-TOP:3PX solid black;
BORDER-BOTTOM:3PX solid black;
border-left:3px solid white;
}

</style>

<body>
<div id= "Right" >
<span class= "SP1" >
<span class= "SP2" ></span>
</span>
</div>
</body>

<title> Sharp Corner div</title>
<style type= "Text/css" >
#right
{
width:400px;
height:250px;
BORDER:3PX solid; /* Border Width is 3px */
position:relative;
}
. sp1,.sp2
{
Display:block;
height:0px;
width:0px;
Position:absolute;
font-size:0;
line-height:0;
}
. SP1
{
right:-9px; /* Its absolute value plus span border width is equal to 5 times times the width of the div border */
top:40px; /* It to determine the position of the sharp corner */
border-right:0px;
BORDER-TOP:6PX solid white; /* Notice the change in color */
BORDER-BOTTOM:6PX solid white;
BORDER-LEFT:6PX solid black;
}
. SP2
{
right:6px; /* is twice times the width of its own border */
top:-3px; /* is the width of its own border-1 time times */
border-right:0px;
BORDER-TOP:3PX solid black;
BORDER-BOTTOM:3PX solid black;
border-left:3px solid white;
}

</style>

<body>
<div id= "Right" >
<span class= "SP1" >
<span class= "SP2" ></span>
</span>
</div>
</body>


Finish

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.