0

I used MJML to make a HTML Email Template using it's own markup template language. Saw that in the compiled HTML file the following media query. Is it valid and if so what is it? Never seen it before. I'm assuming it's a bug with MJML?

@media only screen and (max-width:480px) {
    width:320px {
        width:320px;
    }
}

Just to be clear, i'm not asking about the media query, i'm wondering about the selector inside width:320px {}

hungerstar
  • 21,206
  • 6
  • 50
  • 59
Jonathan P
  • 418
  • 5
  • 14
  • Specifically i'm talking about the selector being `width:320px {}` – Jonathan P Mar 08 '18 at 19:51
  • 1
    css permits only letters, numbers, hyphens, and underscores in class and id selector names – trevor Mar 08 '18 at 19:53
  • Possible duplicate of [What does this meant @media only screen and (min-device-width: 320px) and (max-device-width: 480px)](https://stackoverflow.com/questions/16402870/what-does-this-meant-media-only-screen-and-min-device-width-320px-and-max-d) – PM 77-1 Mar 08 '18 at 19:53
  • 1
    No this is not a duplicate – Jonathan P Mar 08 '18 at 20:04
  • I'm voting to close this question as off-topic because Stack Overflow is not a code validation service. There are code validators you can plug your code into to check if it is valid. – TylerH Mar 09 '18 at 14:41
  • Hey ! Maintainer of MJML here. Is this on MJML4 ? Any chance you can open an issue on MJML repository so we can investigate how did it happens ? Thanks ! – iRyusa Mar 12 '18 at 16:26

1 Answers1

2

It's not valid because width:320px isn't a CSS selector - you select via element, classes, etc. but not CSS properties. It's most likely a bug.

jayly
  • 156
  • 6
  • Okay that's what I thought. I assumed it wasn't a selector as i've never seen it before and i'm well seasoned with not just css but the pro-processors also. You never know however haha could of been something new that I didn't know. Thanks for the comment! – Jonathan P Mar 08 '18 at 20:01
  • I just assumed that MJML being so popular and professional it wouldn't have such bug in the compilation process but there you go! – Jonathan P Mar 08 '18 at 20:03
  • 1
    yep, bugs can be found anywhere! even if the service is popular. :) – jayly Mar 08 '18 at 20:25