Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
143 views
in Technique[技术] by (71.8m points)

html - Is there a CSS property to control or set the length of each side of a div


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You should try this..

div {    
  width:250px;
  height:100px;
  border:2px solid red;        
  margin-left:100px;
  margin-bottom: 0;
  margin-top: 5px;
}
.trapezium {
  margin-top: 0;
  border-top-width:4px;
  border-bottom-width:1px;
  -webkit-transform: perspective(150px) rotateX(40deg);    
}
<div class="trapezium"></div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...