我正在尝试使
标签的文本在不同屏幕大小上改变文字颜色,因为我的网页有一张图片,使得文字不可读。
任何帮助都将不胜感激。
我使用了@media和@keyframe CSS动画来实现这个目标,但它没有起作用,也许我漏掉了一些东西。
HTML:
<div class="container-fuid section section-contact" id="contact">
<div class="row text-center">
<h1>Contact Us</h1>
<h3>
Looking for a quo<span class="span1">te for your next</span> <spanclass="span2">project?</span>
</h3>
<address>
<strong><i class="icon-phone"></i> PHONE NUMBER:</strong><br>
<span>0000000000000</span><br>
<strong><i class="icon-envelope"></i> EMAIL:</strong<br>
<strong> <a href="mailto:hello@me.com">hello@me.com</a></strong>
</address>
</div>
</div>
CSS
:
.section.section-contact{
width:100%;
height: 70%;
background-color: #fe523e;
margin: 0;
background-size: 100% auto;
background-image:url('../img/contact-right.png');
background-repeat: no-repeat;
background-position: right;
background-size: 70.05%;
}
@media all and (min-width: 320px) and (max-width: 900px) {
.section.section-contact{
background-size: 100%;
}
}
.section.section-contact div {
font-weight: 100;
font-size: 20px;
}
.section.section-contact h1{
font-weight: 900;
font-size: 3em;
color: #083858;
text-transform: uppercase;
padding-top: 30px;
}
.section.section-contact h3{
font-weight: 400;
font-size: 30px;
color: #083858;
text-transform: uppercase;
padding-top: 20px;
white-space: nowrap;
text-align: center;
}
/** make text color change at different screen size BEGIN */
.section.section-contact .span2{
animation-name: span2;
animation-duration: 5s;
animation-iteration-count:infinite;
}
@media (max-width: 1356px) {
.section.section-contact .span2{
@keyframes span2 {
from {background-color: whitesmoke}
to {background-color: #083858;}
}
}
}
.section.section-contact .span1{
animation-name: span1;
animation-duration: 5s;
animation-iteration-count:infinite;
}
@media (min-width: 1200px) {
.section.section-contact .span1{
@keyframes span1 {
from {background-color: #083858;}
to {background-color: whitesmoke;}
}
}
}
/** make text color change at different screen size END*/
任何帮助都将不胜感激。