Hi,
I am trying to get media query to adjust the view of my project at my mobile phone. I have Samsung A6.
I found on the Internet that resolution of this phone is: 1480x720px. Whatever break point I put, no matter how wide/high or how narrow/short it is, media query has no effect on the view from my mobile. At the same time, view from my lap-top window does appear to be affected, as I narow it down. From mobile phone I watch my project via link that I sent to myself through mail (not sure this is relevant).
Is media query break point same as phoneâs resolution, or those are two different things?
Furthermore, for mobile view, I am trying to seperate ânew quoteâ and âtweetâ buttons apart, to make them equal and have them in the same row. I beleive that code I put within media query is excessive, but not sure what can I leave out.
Mobile phone sreens:
Mobile 1: buttons are too big, unequal in size, next to each other.
Mobile 2: I have to scroll to see the whole page.
Lap top: All is looking good.
Can you tell us exactly what is not happening with your phone?
If you have a very narrow view then perhaps you donât want them to be in the same row but rather one on top of the other in the same column?
Regardless, I would use a narrow-first approach to style this. Narrow your browser as skinny as it will go and style the page to look good (donât use any break points here, this is your default CSS). Then after you have it looking good at the narrow view you can slowly widen your browser and add a break point when you think you have enough horizontal space to change the layout of elements. Use min-width for the break point, and I would suggest using em units instead of px, that way the content dictates when the break point occurs, not some arbitrary px widths.
This will apply the rule to devices whose maximum width is 180px, i.e. smaller than 180px - as your phone screen is wider than 180px the rules in this media query will not apply.
There are so many devices these days, you cannot expect to add media queries for specific ones! A guide I found gave this:
Large Desktop: @media screen and (min-width: 1200px){... /* css rules */ ... }
I agree with @bbsmooth though - it is generally more simple to design your page for narrow view (i.e. mobile) first and then add media queries as devices get wider. When you do this, you donât need the âMobileâ media query breakpoint, just the subsequent wider ones.
I would probably put the New Quote button on top of the Tweet button so they are in one column.
Vertical scroll is completely fine and you donât need to anything special to avoid it. But you could reduce the amount of padding around the box and make the font slightly smaller (donât go overboard on this, it should still be readable).