Подробное описание и демонстрация работы блока «Вертикальные вкладки» для сайта под номером №25 для библиотеки Bootstrap. Html и CSS код для реализации блока forms на сайте как на изображении.

Section 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce semper, magna a ultricies volutpat, mi eros viverra massa, vitae consequat nisi justo in tortor. Proin accumsan felis ac felis dapibus, non iaculis mi varius.

Section 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce semper, magna a ultricies volutpat, mi eros viverra massa, vitae consequat nisi justo in tortor. Proin accumsan felis ac felis dapibus, non iaculis mi varius.

Section 3

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce semper, magna a ultricies volutpat, mi eros viverra massa, vitae consequat nisi justo in tortor. Proin accumsan felis ac felis dapibus, non iaculis mi varius.

html разметка и css стили для реализации блока «Вертикальные вкладки»
<div class="container">
    <div class="row">
        <div class="col-md-6">
            <div class="vertical-tab" role="tabpanel">
                <!-- Nav tabs -->
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active"><a href="#Section1" aria-controls="home" role="tab" data-toggle="tab">Section 1</a></li>
                    <li role="presentation"><a href="#Section2" aria-controls="profile" role="tab" data-toggle="tab">Section 2</a></li>
                    <li role="presentation"><a href="#Section3" aria-controls="messages" role="tab" data-toggle="tab">Section 3</a></li>
                </ul>
                <!-- Tab panes -->
                <div class="tab-content tabs">
                    <div role="tabpanel" class="tab-pane fade in active" id="Section1">
                        <h3>Section 1</h3>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce semper, magna a ultricies volutpat, mi eros viverra massa, vitae consequat nisi justo in tortor. Proin accumsan felis ac felis dapibus, non iaculis mi varius.</p>
                    </div>
                    <div role="tabpanel" class="tab-pane fade" id="Section2">
                        <h3>Section 2</h3>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce semper, magna a ultricies volutpat, mi eros viverra massa, vitae consequat nisi justo in tortor. Proin accumsan felis ac felis dapibus, non iaculis mi varius.</p>
                    </div>
                    <div role="tabpanel" class="tab-pane fade" id="Section3">
                        <h3>Section 3</h3>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce semper, magna a ultricies volutpat, mi eros viverra massa, vitae consequat nisi justo in tortor. Proin accumsan felis ac felis dapibus, non iaculis mi varius.</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
a:hover,a:focus{
    text-decoration: none;
    outline: none;
}
.vertical-tab{
    font-family: 'Ubuntu', sans-serif;
    display: table;
}
.vertical-tab .nav-tabs{
    display: table-cell;
    width: 28%;
    min-width: 28%;
    border: none;
    vertical-align: top;
    position: relative;
}
.vertical-tab .nav-tabs li{
   float: none;
   vertical-align: top;
}
.vertical-tab .nav-tabs li a{
    color: #e44251;
    background-color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 10px 15px;
    margin: 0 3px 5px 0;
    border-radius: 20px;
    border: 2px solid #e44251;
    overflow: hidden;
    position: relative;
    z-index: 1;
    transition: all 0.20s ease 0s;
}
.vertical-tab .nav-tabs li a:hover,
.vertical-tab .nav-tabs li.active a,
.vertical-tab .nav-tabs li.active a:hover{
    color: #fff;
    background-color: transparent;
    border: 2px solid #e44251;
    border-radius: 0;
}
.vertical-tab .nav-tabs li a:before,
.vertical-tab .nav-tabs li a:after{
    content: '';
    background-color: #e44251;
    height: 100%;
    width: 100%;
    border-radius: 50%;
    transform: scale(0) rotateX(360deg);
    position: absolute;
    left:0 ;
    top: 0;
    z-index: -1;
    transition: all 0.3s;
}
.vertical-tab .nav-tabs li a:after{
    background-color: transparent;
    border-radius: 0;
    transform: scale(0.7);
    transition-delay: 0.1s;
}
.vertical-tab .nav-tabs li.active a:before,
.vertical-tab .nav-tabs li a:hover:before{
    border-radius: 0;
    transform: scale(1) rotateX(0);
}
.vertical-tab .nav-tabs li.active a:after,
.vertical-tab .nav-tabs li a:hover:after{
    background-color: #e44251;
    opacity: 0;
    transform: scale(1.4);
}
.vertical-tab .tab-content{
    color: #fff;
    background-color: #3a4092;
    font-size: 14px;
    letter-spacing: 1px;
    line-height: 23px;
    margin-top: 10px;
    padding: 10px 17px 5px;
    display: table-cell;
    position: relative;
}
.vertical-tab .tab-content h3{
    text-transform: uppercase;
    margin: 0 0 7px 0;
}
@media only screen and (max-width: 479px){
    .vertical-tab .nav-tabs{
        display: block;
        width: 100%;
        border-right: none;
    }
    .vertical-tab .nav-tabs li a{
        margin: 0 0 5px;
    }
    .vertical-tab .tab-content{
        display: block;
        padding: 20px 15px 5px;
    }
    .vertical-tab .tab-content h3{ font-size: 18px; }
}


Теги:
0

Оставить своё мнение

Ваш e-mail не будет опубликован. Обязательные поля помечены *