コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4280 ビュー

Dear all,


We have a website for which we would like to use a separate template for the mobile version. We have not found any documentation on how to do it. How can we do this? 


Best,

アバター
破棄
最善の回答

Hi,

For that, you need to create two templates, One desired for the desktop and the other one desired for mobile. Next what you have to do is do the styling for both templates using media query. Choose the screen width to show the mobile screen view and using the class or id for the top tag of mobile view and desktop view, give css as follows.

@media (max-width: 'give the screen width') {
'selector for mobile template' {
display: block;
}
'selector for desktop template' {
display: none;
}
}

Please note that first you need to give 'd-none' in mobile template to hide it in normal screen.

Or you can also achieve this using bootstap classes.

Screen size Class
Hidden on all                 .d-none
Hidden only on xs          .d-none .d-sm-block
Hidden only on sm         .d-sm-none .d-md-block
Hidden only on md         .d-md-none .d-lg-block
Hidden only on lg            .d-lg-none .d-xl-block
Hidden only on xl            .d-xl-none .d-xxl-block
Hidden only on xxl          .d-xxl-none
Visible on all                   .d-block
Visible only on xs           .d-block .d-sm-none
Visible only on sm          .d-none .d-sm-block .d-md-none
Visible only on md          .d-none .d-md-block .d-lg-none
Visible only on lg            .d-none .d-lg-block .d-xl-none
Visible only on xl            .d-none .d-xl-block .d-xxl-none
Visible only on xxl          .d-none .d-xxl-block

Regards

アバター
破棄
関連投稿 返信 ビュー 活動
0
5月 20
2600
1
6月 24
3444
1
10月 22
3334
1
12月 21
4394
1
2月 21
1890