Module:NavboxMobile: Difference between revisions
EnWikiAdmin (talk | contribs) No edit summary |
EnWikiAdmin (talk | contribs) No edit summary |
||
Line 227: | Line 227: | ||
:cssText(args.basestyle) | :cssText(args.basestyle) | ||
:cssText(args.titlestyle) | :cssText(args.titlestyle) | ||
:css('position', 'relative') -- Ensure relative positioning for absolute children | |||
-- Add the navbar, | -- Add the title content, centered across the full width | ||
titleCell | |||
:tag('div') | |||
:css('margin', '0 auto') | |||
:css('text-align', 'center') | |||
:wikitext(addNewline(args.title)) | |||
-- Add the navbar, positioned absolutely in the top-right corner | |||
if has_navbar() then | if has_navbar() then | ||
titleCell | titleCell | ||
:tag('div') | :tag('div') | ||
:addClass('navboxMobile-navbar') | :addClass('navboxMobile-navbar') | ||
:css(' | :css('position', 'absolute') | ||
:css(' | :css('top', '0') | ||
:css('right', '0') | |||
:css('padding', '0.2em') -- Optional: Adjust padding for alignment | |||
:wikitext(navbar{ | :wikitext(navbar{ | ||
args.name, | args.name, | ||
Line 241: | Line 251: | ||
}) | }) | ||
end | end | ||
end | end | ||