How does zblog show/hide the sidebar module on the mobile end

Li Yang's Blog 2020-04-08 2.47 W Reading 10 Comments

Tips: This article has exceeded one thousand four hundred and seventy-six No update in days, please note whether relevant content is still available!

about Zblog topic The mobile terminal of templates adopts different solutions for different themes. Some are displayed by default, and some do not display the sidebar. There is no perfect solution, so today I will spare some time to teach you how to display or hide the content of the sidebar template. There is no sidebar for the theme of Tranquility Zhiyuan, so we take this theme template as an example to start irrigation...

 How does zblog show/hide the sidebar module on the mobile end

First open Google Browser (QQ/Sogou/360 browser high-speed mode is also OK), then right click the blank space of the webpage, click "Check" as shown in the figure (other browsers may be called "Review Elements"), or use the shortcut key "F12".

 How does zblog show/hide the sidebar module on the mobile end

  • Then a status bar will be displayed at the bottom of the page, click the left side“ mobile phone ”Icons, I don't know what they are Look at the picture:

 How does zblog show/hide the sidebar module on the mobile end

  • Then the overall layout changes. Mm-hmm. This icon means to simulate the mobile phone, and then on the right side, click“ Three points ”, and then click the icon on the far right "Do not understand the picture:

 How does zblog show/hide the sidebar module on the mobile end

  • The page changes again to vertical screen, and the pixel size can be adjusted at the top, as shown in the figure:

 How does zblog show/hide the sidebar module on the mobile end

  • Some websites may be opened“ Shield F12 ”The function of Developer Mode (Check, review the names of elements, etc.), unable to view specific elements, teach you a method, open Baidu , follow the above steps, and then click the website to change to a website with blocked developer mode. So, those who always like to block F12, really don't understand the meaning; The code of chicken ribs has no effect at all. The next step is the preparation before, and the next step is the focus.

  • First, we slide the page to the bottom, then click the mouse icon as shown in the figure, and then slide the page at will, and the corresponding module code will be displayed on the right side, such as the topic DIV module in the figure. Because the topic template has hidden the sidebar, the specific element value cannot be found, and then we can view other modules under the topic module.

 How does zblog show/hide the sidebar module on the mobile end Page 6

  • Slide the mouse over the module on the right, and the corresponding module will be displayed on the left, as shown in the figure:

 How does zblog show/hide the sidebar module on the mobile end Page 7

  • From here, we should know which sidebar is“ side fr ”This DIV can always be found when you look for it slowly. The name of the side bar is generally the sidebar. Just find it directly, and then check the code: as shown in the figure, the side module is hidden when the screen pixel is less than 999px, as shown in the figure:

 How does zblog show/hide the sidebar module page 8 on the mobile end

  • At this time, we click the plus sign on the right to automatically create a new css, as shown in the figure:

 How does zblog show/hide sidebar module page 9 on the mobile end

  • Click the space between curly braces {} and enter the code:“ display: block; ”Then the sidebar we need is displayed.

 How does zblog show/hide the sidebar module on the mobile terminal Page 10

  • After we know the div class alias, we copy the code in the red box on the right, log in to the website background, set the theme, find the custom css interface reserved for the theme (if not, we can only modify it in the style sheet), and paste the code:

 .side.fr {display:block; }
  • This is not enough, because we just saw that the code was hidden first on the mobile phone, so we need to add screen size to the code:

 @media screen and (max-width:999px){     .side.fr {display:block;} }
  • We need to change 999px to a suitable size. It is recommended that the size be smaller because the screen is too wide and the side bar display is unfriendly and ugly. It is recommended to change it to 560px , which means that the sidebar is hidden between 999px-561px and the sidebar module is displayed below 560px.

  • Then click Turn on custom css Click the Save button at the bottom to refresh the foreground to see if it is displayed.

  • This is the display module course To hide, it is also simple. First, determine the size of the mobile terminal screen pixels, such as less than 999px. Then the hidden code is:

 @media screen and (max-width:999px){     .side.fr {display:none!important; }  }
  • Put“ block ”Replace with“ none ”, why add one ! important , which means priority display.

Now that the tutorial is over, I feel that I am not suitable for writing the tutorial. Previously, I wrote the tutorial in short form, but after it was released, many people could not understand it. Since then, I have written the tutorial step by step, which is obviously a very simple problem. After writing the tutorial, it is a big article. For example, today, the steps are very simple, Open the web page, F12 developer mode, view the module, assign the show/hide code, and then put the code in the custom css to open the custom css , done.

The same sentence zblog Rely less plug-in unit For the sake of good, unless some necessary plug-ins are available, for example, a plug-in that you don't install is just like a piece of goods. If there is too much goods, it will cost the car and fuel. One day, I will write another article about the use of plug-ins by zblog...

Article copyright notice: unless otherwise noted Lao Li's Notes For original articles, reprints or copies, please use hyperlinks and indicate the source.

Comment

Quick reply: expression:
 Addoil Applause Badlaugh Bomb Coffee Fabulous Facepalm Feces Frown Heyha Insidious KeepFighting NoProb PigHead Shocked Sinistersmile Slap Social Sweat Tolaugh Watermelon Witty Wow Yeah Yellowdog
Comment List (Yes ten Comments, twenty-four thousand six hundred and eighty People around)
 Netizen nickname: feifei
feifei V Iron powder  Google Chrome 83.0.4103.106  Windows 10 x64 6th floor
2021-02-17 From Shanghai reply
The source code of the blog is good, and I want to buy a one dime
 Netizen nickname: Li Yang Blog
Li Yang's Blog V Blogger  Sogou Explorer  Windows 10 x64
2021-02-18 From Tianjin reply
@feifei Postcard theme template, 158 yuan.
 Netizen nickname: Today's news
What's new today V Iron powder  Google Chrome 78.0.3904.108  Windows 7 floor
2021-02-03 From Guangdong reply
The article is good, I really like it
 Netizen nickname: Li Yang Blog
Li Yang's Blog V Blogger  Sogou Explorer  Windows 10 x64
2021-02-03 From Tianjin reply
@What's new today Thank you for your support!
 Netizen nickname: Station element host
Station element host V Iron powder  Firefox 82.0  Windows 10 x64 summer sleeping mat
2020-11-12 From Tianjin reply
Like one after learning
 Netizen nickname: Fang Cun
Size V Iron powder  zBrowser 8.16.1  Android 9 Bench
2020-11-03 From Guangdong reply
[Apply] Yes Yes
 Netizen nickname: Deyantang
Deyantang V Iron powder  Google Chrome 69.0.3497.100  Windows 10 x64 chair
2020-04-20 From Guangdong reply
Blogger, why can't the theme of koi be displayed in the sidebar?
My web address: http://www.deyanwenhua.com
Thanks for your guidance!
 Netizen nickname: Li Yang Blog
Li Yang's Blog V Blogger  Sogou Explorer  Windows 10 x64
2020-04-21 From Tianjin reply
@Deyantang No, the Koi is displayed by default. Have you modified any code?
 Netizen nickname: Heart
heart V Iron powder  Google Chrome 78.0.3904.108  Windows 10 x64 sofa
2020-04-14 From Shanghai reply
I learned a lot from Lao Li, so I should send more articles of this kind. The article is good and well written!
 Netizen nickname: Li Yang Blog
Li Yang's Blog V Blogger  Sogou Explorer  Windows 10 x64
2020-04-14 From Tianjin reply
@Heart 3Q, thank you for your support!
 cancel
 WeChat QR code
 WeChat QR code
 Alipay QR code