How do I do the following CSS media query in Reactjs?
.heading {
text-align: right;
/* media queries */
@media (max-width: 767px) {
text-align: center;
}
@media (max-width: 400px) {
text-align: left;
}
}
I tried the following but it throws a syntax error and fails to compile.
heading: {
textAlign: 'right',
@media (maxWidth: '767px') {
textAlign: 'center';
}
@media (maxWidth: '400px') {
textAlign: 'left';
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…