Отзывчивый дизайн «CSSREGistration не имеет общественного недвижимости с именем СМИ»

sharepoint.stackexchange https://sharepoint.stackexchange.com//questions/85503

Вопрос

Я в настоящее время реализую отзывчивый дизайн на интрасети.Я добавил обычные ссылки на главную страницу на основе минимальных и максимальных средств массовой информации.Он работает как очарование, но он не пытался использовать CSSGistration.По какой-то неизвестной причине CSSCregistration не имеет свойства средств массовой информации (что я знаю).Есть ли способ преодоления этой проблемы с использованием CSSREGistration вместо простого HTML-ссылок?

<!-- Responsive CSS-files based on width -->
<link type="text/css" rel="stylesheet" media="only screen and (min-width: 801px)" href="/Style%20Library/css/ResponsiveMaster.css" />
<link type="text/css" rel="stylesheet" media="only screen and (min-width: 401px) and (max-width: 800px)" href="/Style%20Library/css/ResponsiveMasterPad.css" />
<link type="text/css" rel="stylesheet" media="only screen and (max-width: 400px)" href="/Style%20Library/css/ResponsiveMasterMobile.css" />
.

Если я попробую, я получаю хорошо известный экран:

Введите описание изображения здесь

Это было полезно?

Решение

As you say, there is no media attribute.

There are a couple of ways I can think of to handle this in SharePoint:

  • Either use Device Channels to target different master pages to different devices
  • Or, add all of your responsive CSS to one file, containing the @media wrappers. This will also be better since if you for example resize your browser window, you get the appropriate css as you go.
  • A third way that comes to mind is using a combination of @media and @import tags in one CSS-file, loading in specific files with the @import into the @media attribute
Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top