dtfo55908 2014-09-12 10:17
浏览 25
已采纳

基于PHP变量的CSS媒体查询

I have a multi-lingual website where all the text for the site is being loaded in based on a PHP session variable for each language. My problem here is that when the text is loaded in German, the menu bar on the top of my page becomes too long for it's container and some menu items drop below. This would be okay but the menu items that get dropped down are blocking sub menus from being selected.

Is there a way to use css media queries to reduce font size of my menu when a certain variable is selected?

  • 写回答

3条回答 默认 最新

  • dongqu1783 2014-09-12 10:21
    关注

    There's no such media query but what you can do:

    1. check if language in session is German
    2. If no, do nothing more than you do at the moment
    3. If yes, load one extra CSS file or extra rule where you have defined font-size for example this way:
    nav ul li {
      font-size: 10px;
      font-size: 0.8rem;
    }
    

    This will change nothing for other language and for German language you can define custom CSS (font-size or of course anything else)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?