Title: Writing CSS
Last modified: October 5, 2019

---

# Writing CSS

 *  [tapiohuuhaa](https://wordpress.org/support/users/tapiohuuhaa/)
 * (@tapiohuuhaa)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/writing-css/)
 * This is just a tip. I have noticed, that Code Snippet can’t reliable show correctly{
   + } with CSS.
 * But if you use quite minimized CSS (almost full minimized) just separating [@media](https://wordpress.org/support/users/media/)
   into own row, showing start and end tags works reliable
 * > `@media screen and (max-width:782px){
   >  #tabA .mobile-search-top,#tabC .mobile-
   > search-top,#right-own-sidebar-top .mobile-search-top{display:none!important;}#
   > tabA .separator-first {margin-top:15px}#tabC .list-container {padding-top:20px;}#
   > search-button,#search-button a{position:fixed;top:0;right:0px;}}

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [tapiohuuhaa](https://wordpress.org/support/users/tapiohuuhaa/)
 * (@tapiohuuhaa)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/writing-css/#post-12000247)
 * I found that this doesn’t always help. Code Snipped highlighted incorrectly this
   code:
 * > `if($blogi && !tap_is_mobile()){
   >  $CSS=$CSS.’@media screen {body.page #colophon,
   > body.page #colophon #suplementary,body.page #colophon #suplementary #footer-
   > sidebar{display: block!important;overflow-x:hidden}body.page #colophon #suplementary#
   > custom-html-7,body.page #colophon .site-info,body.page #colophon #oa-social-
   > login-2{display:none!important;}}’; } }`
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/writing-css/#post-12000403)
 * Code Snippets is set to highlight PHP by default, so CSS highlighting will not
   always work correctly.
 * It’s not something to worry about, though, as the highlighting has no effect 
   on the code execution.
 *  Thread Starter [tapiohuuhaa](https://wordpress.org/support/users/tapiohuuhaa/)
 * (@tapiohuuhaa)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/writing-css/#post-12000736)
 * The problem in my last example was that I often mix CSS & PHP. When CSS higlighting
   goes wrong, then also PHP highlighting might be wrong and I must myself check,
   which is the closing } for PHP. Code Snippet didn’t show the end } of the if 
   statement.
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/writing-css/#post-12356381)
 * Unfortunately this is mostly a limitation of the CodeMirror syntax highlighter
   when highlighting pure PHP snippets. I can see what I can do, but it’s not something
   I have a lot of control over.
 * Your second example, especially, seems a little tricky – I’m not sure how CSS
   code in a string could be detected and correctly highlighted.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Writing CSS’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 4 replies
 * 1 participant
 * Last reply from: [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/writing-css/#post-12356381)
 * Status: not a support question