Wednesday, 10 June 2015

Create diagonal border of a cell






HTML :

<div id="square">
      <span id="room">ROOM TYPE</span>
       <span id="hosp">HOSPITALITY</span></div>
<div id="line"></div>


CSS :

#square {
    position: absolute;
    top: 100px;
    left: 100px;
    background: #3b2a32;
    border: 2px solid #ad1b59;
    color: #ad1b59;
    height: 200px;
    width: 400px;
    font-family: arial, verdana;
    font-size: 22px;
    font-weight: bolder;
}

#room {
    display: block;
    position: absolute;
    top: 50px;
    left: 220px;
}

#hosp {
    display: block;
    position: absolute;
    top: 140px;
    left: 50px;
}


#line {
    position: absolute;
    top: 190px;
    left: 33px;
    height: 200px;
    width: 450px;
    border-top: 2px solid #ad1b59;   
    -webkit-transform: rotate(26.5deg);
       -moz-transform: rotate(26.5deg);
        -ms-transform: rotate(26.5deg);
         -o-transform: rotate(26.5deg);
            transform: rotate(26.5deg);
}

Post a Comment