I’m building my first responsive WordPress theme, but getting my media query for portrait has stopped working when I’ve converted the static HTML to a theme. The weird thing is that the portrait query worked fine as a static site.
This is my code:
@media all and (orientation: portrait) {
#main {
display: table;
max-width: 100%;
}
#content img {
width:100%;
height:auto;
display: table-cell;
vertical-align: middle
}
#tabbtn {
width:20%;
min-width: 30px;
}
}
& this is the error that shows up on the W3C validation check:
Parse Error [ @media all and (orientation: portrait)]
Any help much appreciated!
Ah, for anyone looking – the actual error was the fact that the image wasn’t responding to my fluid CSS (due to WordPress adding fixed height/width). I didn’t realise this before. The parse error, I think, was irrelevant.
Currently now trying to solve the problem with the info here: http://www.netmagazine.com/tutorials/getting-wordpress-play-nice-responsive-images