제목 : 브라우저 왼쪽/오른쪽 중간에 항상 고정된 텍스트/이미지 배치하기
Bootstrap 3를 활용하여,
웹 브라우저의 좌우에 특정 텍스트 또는 이미지를 배치하고자할 때 사용할만한
스타일시트입니다.
페이지를 전환하는 뷰 스위처(View Switcher) 역할로 만들어 봤습니다.
<style>
.view-switcher-control {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 5%;
opacity: 0.5;
filter: alpha(opacity=50);
font-size: 20px;
color: #ffffff;
text-align: center;
-webkit-text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.view-switcher-control.left {
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0%), color-stop(rgba(0, 0, 0, 0.0001) 100%));
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=''#80000000'', endColorstr=''#00000000'', GradientType=1);
}
.view-switcher-control.right {
left: auto;
right: 0;
background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0%), color-stop(rgba(0, 0, 0, 0.5) 100%));
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=''#00000000'', endColorstr=''#80000000'', GradientType=1);
}
.view-switcher-control:hover,
.view-switcher-control:focus {
outline: none;
color: #ffffff;
text-decoration: none;
opacity: 0.9;
filter: alpha(opacity=90);
}
.view-switcher-control .icon-prev,
.view-switcher-control .icon-next,
.view-switcher-control .view-switcher-icon-left,
.view-switcher-control .view-switcher-icon-right {
position: absolute;
top: 50%;
z-index: 5;
display: inline-block;
}
.view-switcher-control .icon-prev,
.view-switcher-control .view-switcher-icon-left {
left: 50%;
}
.view-switcher-control .icon-next,
.view-switcher-control .view-switcher-icon-right {
right: 50%;
}
@media screen and (max-width: 768px) {
.view-switcher-control,
.view-switcher-control .view-switcher-icon-left,
.view-switcher-control .view-switcher-icon-right,
.view-switcher-control .icon-prev,
.view-switcher-control .icon-next {
display: none;
visibility: collapse;
}
}
</style>
<a class="view-switcher-control left" href="#">
<span class="view-switcher-icon-right"><img src="images/right_arrow.png" /></span>
</a>
<a class="view-switcher-control right" href="#">
<span class="view-switcher-icon-right"><img src="images/right_arrow.png" /></span>
</a>