Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Media Queries aren't being called

Featured Replies

Hi all,

 

Can anyone tell me why my some media query declaration are not being called?

 

I know media queries should be placed at the bottom of a stylesheet, but they only seem to work when I place them at the top and in some cases the original declarations are called.

 

Here is a media query I set:

@media(max-width: 640px) {
	.copyrightwrapper {
		position: relative;  top: 0; bottom: 0;
		float: left;
		width: 100%;  height: 30px;
		margin: 20px 0 0 0;  padding: 5px 0px 25px 0px;
		font-family: Arial, Helvetica, sans-serif;  font-weight: bold;  color: #999;
		border-top: solid 1px #ccc;
	}
}

Here is what's called even though my browser width is below 640px width:

.copyrightwrapper {
	position: relative;
	top: 30px;
	bottom: 0px;
 	float: left;
	width: 904px;
	color: #999;
	padding: 5px 0px 25px 0px;
	margin: 20px 15px 0 15px;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
	border-top: solid 1px #ccc;
} 

Here's the page I'm using the CSS on.

Edited by Demonolith

  • Author

 

If you have two lines of css that are similar, the last one is the one that will take effect.

 

In that case, would I need to move the media queries below what is mistakenly being called?

 

When I do nothing is called.

  • Author

 

 

Does that make sense?

 

Got it, thanks.

 

I also had a typo in my CSS that was preventing the media queries from being read when placed at the bottom.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.