As I strive to optimize my website for mobile devices, I am encountering an issue with my media queries. The classes don't seem to respond appropriately on any page other than the index.html, and I'm struggling to identify the root cause.
Index.html:
html ng-app='skypeClone'
`
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="styles.css">
<title>Skype Clone</title>
</head>
<body ng-controller='mainCtrl'>
<ui-view class="view"></ui-view>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.18/angular-ui-router.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.js"></script>
<script src="//cdn.temasys.com.sg/skylink/skylinkjs/0.6.x/skylink.complete.min.js"></script>
<script src="js/app.js"></script>
<script src="js/mainCtrl.js"></script>
<script src="js/helpCtrl.js"></script>
<script src="js/loginCtrl.js"></script>
<script src="js/loginSvc.js"></script>
<script src="js/createUserCtrl.js"></script>
<script src="js/createUserSvc.js"></script>
<script src="js/service.js"></script>
<script src="js/userHomeCtrl.js"></script>
</body
</html>
` If the commented out code isn't showing up, I have tried media queries with and without the meta name="viewport" content="width=device-width, initial-scale=1.0"
Other Route:
`
<div id="background-setter-homepage">
<div id="header-wrap">
<div id="header">
<button class="button" id="help" ui-sref='help'>Help</button>
<button class="button" id="about" ui-sref='about'>About</button>
<button class="button" id="login" ui-sref='login'>Login</button>
</div>
</div>
<br><br>
<div class="middleOfPage" id="container">
<div id="text-and-button">
<h2 id="phrase">Skyclone keeps the world talking, for free</h2> <br>
<button class="button" id="getStarted" ui-sref='createUser'>Create An Account</button>
<div>
</div>
</div>
`
I simply want to test changing the color of the 'phrase' class in the h2 element when the screen reaches a specific max-width using CSS.
CSS:
`
@media (max-width: 375px) {
#phrase{
color: lightgreen;
}
}
` I've also attempted:
`
@media only screen and (max-width: 800px) {
#phrase{
color: lightgreen;
}
}
` The above code is not functioning as expected. However, if I apply the same width condition to the class within ui-view in the index.html file and set visibility to none, it partially works but not entirely.
Have you encountered this challenge before? I would greatly appreciate any assistance or insights. Thank you in advance!