How can I hide text only from desktop on a Wikimedia wiki (Romanian Wikipedia)? In other words, that text should be visible only from mobile, but from desktop no. The context is ro:Special:Diff/14156938.
Topic on Extension talk:MobileFrontend
An answer?
You'll have to define a custom CSS class in your wiki's MediaWiki:Common.css file, with display: none;
. For my wikis, I've used the class name mobile-show
, but given the nomobile
class included in the default styles (via Ext:MobileFrontend? I'm not actually sure), a class name such as nodesktop
might make more sense/be easier to remember.
@Dinoguy1000: But what is the text that I should add in MediaWiki:Common.css?
.your_class_name {
display: none;
}
Replace your_class_name
with whatever name you decide to use for the class (note that the period before the name is not a mistake; this is what identifies it as a class to your browser).
@Dinoguy1000: ro:Utilizator:NGC 54/Teste and ro:Utilizator:NGC 54/PP1/Mobil/common.css. It does not work. Does it is possible to display Utilizator:NGC 54/PP1 as the Main Page for desktop and ro:Utilizator:NGC 54/PP1/Mobil as the Main Page for mobile without using tags like "nomobile", "mobileonly", "nodesktop", "mobile-show"...?
The CSS page you linked is not being applied to the test page you linked. In order to do that, you need to use Extension:TemplateStyles instead of putting the page name in a class
attribute.
@Dinoguy1000: The content is now hidden both from mobile and desktop.
Yes, because your CSS file is being applied both on desktop and mobile. My original advice was based on putting the CSS in your wiki's MediaWiki:Common.css file, since that page is only loaded on desktop. If you instead intend for the CSS to be used via TemplateStyles, you'll have to add extra selectors to prevent it being applied when on mobile; unfortunately, I don't really know how to do this beyond vague ideas.