Module:NavboxMobile: Difference between revisions

No edit summary
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
         -- Remove position: relative


    -- Add the title content, centered
     -- Add the navbar, float it to the right
    titleCell
        :tag('div')
            :css('margin', '0')
            :css('text-align', 'center')
            :wikitext(addNewline(args.title))
 
     -- Add the navbar, positioned absolutely to not affect the title's centering
     if has_navbar() then
     if has_navbar() then
         titleCell
         titleCell
             :tag('div')
             :tag('div')
                 :addClass('navboxMobile-navbar')
                 :addClass('navboxMobile-navbar')
                 :css('position', 'absolute')
                 :css('float', 'right')
                :css('top', '0')
                 :css('margin-left', '0.5em')
                 :css('right', '0')
                 :wikitext(navbar{
                 :wikitext(navbar{
                     args.name,
                     args.name,
Line 250: Line 242:
                 })
                 })
     end
     end
    -- Add the title content, centered
    titleCell
        :tag('div')
            :css('margin', '0')
            :css('text-align', 'center')
            :wikitext(addNewline(args.title))
end
end