htmlcssmedia-queries

Line break for media-query only?


Is there any solution for line break when screen resolution is small instead of <br>? Because br break line all the time.

Here is my code:

<h2>I create unique, clean sites that are easy to navigate.<br>All my works comply with web</h2>

I think CSS3 may have solution of this issue.

Is there any solution for this <br>, because the line break only needed when page on mobile.


Solution

  • You could simply add a class to the BR tag and set it to be display:none by default.

    Then in your mobile media query set it to "display: static"

    I've suggested static rather than block because I don't think that a BR tag is display block by default so probably best to simply go with static.