Topic on Extension talk:MobileFrontend

Unable to change section headings formatting

6
Humanutario (talkcontribs)

I would like to change the format (size, bold, italic) of the section headers for the mobile version of the site. I tried to add in the Mediawiki:Mobile.css as in the Mediawiki:Commons.css:

#bodyContent h1, firstHeading { font-size: 24px; }
#bodyContent h2 { font-size: 170% !important; font-style:bold !important; } 
#bodyContent h3 { font-size: 150% !important; font-style:bold !important; } 
#bodyContent h4 { font-size: 140% !important; font-style:bold !important; } 
#bodyContent h5 { font-size: 130% !important; font-style:bold !important; } 
#bodyContent h6 { font-size: 120% !important; font-style:italic; }

But it doesn't change anything. Does anyone know how to do?

Thanks by advance.

Jdlrobson (talkcontribs)

Which version of MobileFrontend are you using? Does #bodyContent exist? firstHeading should be #firstHeading

Humanutario (talkcontribs)

I am using MobileFrontend for MediaWiki 1.23. How can I know if #bodyContent exists? Thanks!

Jdlrobson (talkcontribs)

You can try $( '#bodyContent' ).length inside your JavaScript console. If it's === 1 you have it.

note

#bodyContent h1, firstHeading { font-size: 24px; }

should be

#bodyContent h1, #firstHeading { font-size: 24px; }
Jdlrobson (talkcontribs)

If you don't have #bodyContent try using #content.

Humanutario (talkcontribs)

Thanks so much! It works using #content instead of #bodyContent.