2017-01-27 3 views
1

私はウェブ開発の新人です。私は初めてクライアントのためのウェブサイトを作っています。 "INNOATIVE .....教育"という言葉で私のフェードアウトは、私の窓は小さくなります。私は彼らが反応して、一直線に留まることを望みますが、サイズは小さくなります。誰かが私を助けることができれば感謝します。言葉のフェードは反応しません

https://jsfiddle.net/dL9m41se/

Ralevant CSS:

@-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 
@-moz-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 

.fade-in { 
    opacity:0; /* make things invisible upon start */ 
    -webkit-animation:fadeIn ease-in 1; /* call our keyframe named fadeIn, use animattion ease-in and repeat it only 1 time */ 
    -moz-animation:fadeIn ease-in 1; 
    animation:fadeIn ease-in 1; 

    -webkit-animation-fill-mode:forwards; /* this makes sure that after animation is done we remain at the last keyframe value (opacity: 1)*/ 
    -moz-animation-fill-mode:forwards; 
    animation-fill-mode:forwards; 

    -webkit-animation-duration:1s; 
    -moz-animation-duration:1s; 
    animation-duration:1s; 
} 

.fade-in.one { 
-webkit-animation-delay: 0.7s; 
-moz-animation-delay: 0.7s; 
animation-delay: 0.7s; 
/*margin-left: auto; 
    margin-right: auto;*/ 
    /*width: 10%; 
    height: 3%;*/ 
} 

.fade-in.two { 
-webkit-animation-delay: 1.2s; 
-moz-animation-delay:1.2s; 
animation-delay: 1.2s; 
/*margin-left: auto; 
    margin-right: auto;*/ 
/* width: 10%; 
    height: 3%;*/ 
} 

.fade-in.three { 
-webkit-animation-delay: 1.6s; 
-moz-animation-delay: 1.6s; 
animation-delay: 1.6s; 
/*margin-left: auto; 
    margin-right: auto;*/ 
    /* width: 10%; 
    height: 3%;*/ 
} 



.fade-in.four { 
-webkit-animation-delay: 2s; 
-moz-animation-delay: 2s; 
animation-delay: 2s; 
padding-left: 12%; 
/* margin-left: auto; 
    margin-right: auto;*/ 
/* width: 10%; 
    height: 3%; 
}*/ 

} 


.fade-in.five { 
-webkit-animation-delay: 2.4s; 
-moz-animation-delay: 2.4s; 
animation-delay: 2.4s; 
/*margin-left: auto; 
    margin-right: auto;*/ 
/* width: 10%; 
    height: 3%;*/ 
} 



.box{ 
    padding-left:8%; 
    width: 16.7%; 
    height: 5%; 

position: relative; 
margin: .8%; 
float: left; 
overflow:inherit; 
/*border: 1px solid #333; 
background: #999;*/ 
} 

答えて

1

オプションは、サンプル・スニペット

@-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 
 
@-moz-keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 
 
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } } 
 

 
.fade-in { 
 
    opacity:0; /* make things invisible upon start */ 
 
    -webkit-animation:fadeIn ease-in 1; /* call our keyframe named fadeIn, use animattion ease-in and repeat it only 1 time */ 
 
    -moz-animation:fadeIn ease-in 1; 
 
    animation:fadeIn ease-in 1; 
 

 
    -webkit-animation-fill-mode:forwards; /* this makes sure that after animation is done we remain at the last keyframe value (opacity: 1)*/ 
 
    -moz-animation-fill-mode:forwards; 
 
    animation-fill-mode:forwards; 
 

 
    -webkit-animation-duration:1s; 
 
    -moz-animation-duration:1s; 
 
    animation-duration:1s; 
 
} 
 

 
.fade-in.one { 
 
-webkit-animation-delay: 0.7s; 
 
-moz-animation-delay: 0.7s; 
 
animation-delay: 0.7s; 
 
/*margin-left: auto; 
 
    margin-right: auto;*/ 
 
    /*width: 10%; 
 
    height: 3%;*/ 
 
} 
 

 
.fade-in.two { 
 
-webkit-animation-delay: 1.2s; 
 
-moz-animation-delay:1.2s; 
 
animation-delay: 1.2s; 
 
/*margin-left: auto; 
 
    margin-right: auto;*/ 
 
/* width: 10%; 
 
    height: 3%;*/ 
 
} 
 

 
.fade-in.three { 
 
-webkit-animation-delay: 1.6s; 
 
-moz-animation-delay: 1.6s; 
 
animation-delay: 1.6s; 
 
/*margin-left: auto; 
 
    margin-right: auto;*/ 
 
    /* width: 10%; 
 
    height: 3%;*/ 
 
} 
 

 

 

 
.fade-in.four { 
 
-webkit-animation-delay: 2s; 
 
-moz-animation-delay: 2s; 
 
animation-delay: 2s; 
 
padding-left: 12%; 
 
/* margin-left: auto; 
 
    margin-right: auto;*/ 
 
/* width: 10%; 
 
    height: 3%; 
 
}*/ 
 

 
} 
 

 

 
.fade-in.five { 
 
-webkit-animation-delay: 2.4s; 
 
-moz-animation-delay: 2.4s; 
 
animation-delay: 2.4s; 
 
/*margin-left: auto; 
 
    margin-right: auto;*/ 
 
/* width: 10%; 
 
    height: 3%;*/ 
 
} 
 

 

 

 
.box{ 
 
    padding-left:8%; 
 
    width: 16.7%; 
 
    height: 5%; 
 
font-size: 2.5vw; 
 
position: relative; 
 
margin: .8%; 
 
float: left; 
 
overflow:inherit; 
 
/*border: 1px solid #333; 
 
background: #999;*/ 
 
}
<div id="home-slider" class="carousel slide carousel-fade" data-ride="carousel"> 
 
    <div class="carousel-inner"> 
 
     <div class="item active" style="background-image: url(images/slider/1.jpg"> 
 
     <div class="caption"> 
 
      <div class="center-div-words" > 
 
      <h1> <span style="color: #000;font-family: 'Special Elite', cursive; ">CENTER FOR MEMBRANE STUDY</span></h1> 
 
      <p style="font-size: 100%;font-family: 'Special Elite', cursive;"><span class="box fade-in one" id="1">INNOATIVE</span><span class="box fade-in two" id="2">COLLABORATIVE</span><span></span><span class="box fade-in three" id="3"> INTERDISCIPLINARY</span><span class="box fade-in four" id="4">RESEARCH</span> 
 
      <span class="box fade-in five" id="5">EDUCATION</span> 
 
      </p> 
 
      </div><!-- center-div-words --> 
 
     </div> <!-- caption --> 
 
     </div> <!-- image --> 
 

 
    
 

 
</div><!--/#home-slider--> 
 

font-size: 2.5vw; 

フォントサイズのためのビューポート単位vwを使用することです

0

今の言葉が交差しないだろう、あなたのCSSにこれを追加します。 あなたはお互いの下に置く方が良いです。 それらをインラインに保つのは、賢明な対応ではありません。

もちろん最大幅を調整してください。

@media screen and (max-width: 600px){ 
    .box{ 
    width:100%; 
    } 
} 

あなたは私が知っていると私はいくつかのより多くの微調整をします、インラインそれらを維持したいならば!

0

あなたは@mediaクエリで特定のwidthfont-sizeを減らすことができます(デモを16pxに設定されている、あなたの利益のために値を調整する):

@media (max-width: 768px) { 
    p span { 
     font-size: 16px; 
    } 
} 

@-webkit-keyframes fadeIn { 
 
    from { 
 
    opacity: 0; 
 
    } 
 
    to { 
 
    opacity: 1; 
 
    } 
 
} 
 
@-moz-keyframes fadeIn { 
 
    from { 
 
    opacity: 0; 
 
    } 
 
    to { 
 
    opacity: 1; 
 
    } 
 
} 
 
@keyframes fadeIn { 
 
    from { 
 
    opacity: 0; 
 
    } 
 
    to { 
 
    opacity: 1; 
 
    } 
 
} 
 
.fade-in { 
 
    opacity: 0; 
 
    /* make things invisible upon start */ 
 
    -webkit-animation: fadeIn ease-in 1; 
 
    /* call our keyframe named fadeIn, use animattion ease-in and repeat it only 1 time */ 
 
    -moz-animation: fadeIn ease-in 1; 
 
    animation: fadeIn ease-in 1; 
 
    -webkit-animation-fill-mode: forwards; 
 
    /* this makes sure that after animation is done we remain at the last keyframe value (opacity: 1)*/ 
 
    -moz-animation-fill-mode: forwards; 
 
    animation-fill-mode: forwards; 
 
    -webkit-animation-duration: 1s; 
 
    -moz-animation-duration: 1s; 
 
    animation-duration: 1s; 
 
} 
 
.fade-in.one { 
 
    -webkit-animation-delay: 0.7s; 
 
    -moz-animation-delay: 0.7s; 
 
    animation-delay: 0.7s; 
 
    /*margin-left: auto; 
 
    margin-right: auto;*/ 
 
    /*width: 10%; 
 
    height: 3%;*/ 
 
} 
 
.fade-in.two { 
 
    -webkit-animation-delay: 1.2s; 
 
    -moz-animation-delay: 1.2s; 
 
    animation-delay: 1.2s; 
 
    /*margin-left: auto; 
 
    margin-right: auto;*/ 
 
    /* width: 10%; 
 
    height: 3%;*/ 
 
} 
 
.fade-in.three { 
 
    -webkit-animation-delay: 1.6s; 
 
    -moz-animation-delay: 1.6s; 
 
    animation-delay: 1.6s; 
 
    /*margin-left: auto; 
 
    margin-right: auto;*/ 
 
    /* width: 10%; 
 
    height: 3%;*/ 
 
} 
 
.fade-in.four { 
 
    -webkit-animation-delay: 2s; 
 
    -moz-animation-delay: 2s; 
 
    animation-delay: 2s; 
 
    padding-left: 12%; 
 
    /* margin-left: auto; 
 
    margin-right: auto;*/ 
 
    /* width: 10%; 
 
    height: 3%; 
 
}*/ 
 
} 
 
.fade-in.five { 
 
    -webkit-animation-delay: 2.4s; 
 
    -moz-animation-delay: 2.4s; 
 
    animation-delay: 2.4s; 
 
    /*margin-left: auto; 
 
    margin-right: auto;*/ 
 
    /* width: 10%; 
 
    height: 3%;*/ 
 
} 
 
.box { 
 
    padding-left: 8%; 
 
    width: 16.7%; 
 
    height: 5%; 
 
    position: relative; 
 
    margin: .8%; 
 
    float: left; 
 
    overflow: inherit; 
 
    /*border: 1px solid #333; 
 
background: #999;*/ 
 
} 
 
@media (max-width: 768px) { 
 
    p span { 
 
    font-size: 16px; 
 
    } 
 
}
<div id="home-slider" class="carousel slide carousel-fade" data-ride="carousel"> 
 
    <div class="carousel-inner"> 
 
    <div class="item active" style="background-image: url(images/slider/1.jpg"> 
 
     <div class="caption"> 
 
     <div class="center-div-words"> 
 
      <h1> <span style="color: #000;font-family: 'Special Elite', cursive; ">CENTER FOR MEMBRANE STUDY</span></h1> 
 
      <p style="font-size: 100%;font-family: 'Special Elite', cursive;"><span class="box fade-in one" id="1">INNOATIVE</span><span class="box fade-in two" id="2">COLLABORATIVE</span><span class="box fade-in three" id="3"> INTERDISCIPLINARY</span><span class="box fade-in four" id="4">RESEARCH</span> 
 
      <span class="box fade-in five" id="5">EDUCATION</span> 
 
      </p> 
 
     </div> 
 
     <!-- center-div-words --> 
 
     </div> 
 
     <!-- caption --> 
 
    </div> 
 
    <!-- image --> 
 
    </div> 
 
    <!--/#home-slider-->

0

することができます一つの方法これについては、最大幅を設定するためのメディアクエリを追加することで、それが小さくて済むようにしています。

@media only screen and (max-width: 480px) { 
/* This CSS will be applied only to phones and other small devices. */ 
font-size: 20px; width: 100%; } 
//Lots more can be done in there 

また、フレックスボックスで遊ぶこともできます。

<script type="text/javascript"> 
$('#mainNavbar').flexMenu();</script> 

このページをチェックアウトhereこれは、応答性の高いナビゲーションバーの設計/作成に関する小さなチュートリアルを持っています。

関連する問題