Alon Alon -4 years ago 146
CSS Question

How to write different HTML for different screen sizes

I understood how I change CSS via media queries (such as media="screen and (max-width:640px)")

but let's say I want to write (just for example)

<div>
[if screen resolution is lower then 960 px]
<div>
some new text only for lower resolution
</div>
[end of condition]
</div>


What is the condition I need to write to get it right?

Answer Source

As far as i have experienced, you cannot do media queries inside HTML pages. You need to do it from within your CSS.

But if you want to show some special text only when it is below a certain resolution, why not only make it visible when the resolution is lower than 960px?

Creating responsive designs is very different from a regular design, because you have to think a lot more (which is haaard)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download