Tagged: center, header widget, mobile
-
AuthorPosts
-
September 26, 2016 at 5:20 pm #691817
I have a text widget, an image widget and a button widget in my header. In the mobile responsive view, I would like them all centered horizontally on different lines no matter which device or orientation they appear. What is the css code I need to use to make this happen? I’ve tried several variations of css code I’ve found on your support site, but cannot get one that centers them correctly. See below.
Thanks in advance for your help.
September 28, 2016 at 2:03 pm #692650Hey advteksol,
They are centered on my end. Have you been able to figure it out already?
Best regards,
YigitSeptember 28, 2016 at 3:25 pm #692739No. I have them centered for a iPhone 5 vertical view, but if you check the horizontal view (or any tablet view), they are not centered correctly. See the second picture above.
September 30, 2016 at 1:51 pm #693728Hi,
Please try adding this code to the Quick CSS section under Enfold > General Styling or to your child themes style.css file:
@media only screen and (max-width: 480px) { #header .widget { transform: none!important; }}
Best regards,
VinaySeptember 30, 2016 at 6:23 pm #693974No, that actually made things worse. See pics below:
I applied it to both the phone number and the button (and the image for that matter), but they do not center correctly. They should be in the middle of the screen (tablet, phone or whatever mobile), lined up over each other.
October 3, 2016 at 11:52 pm #694802Any thoughts on this?
October 5, 2016 at 2:57 pm #695523Hi,
We are working on your ticket, please wait while we update the results.
Best regards,
VinayOctober 5, 2016 at 4:52 pm #695616Are you still working on this?
October 5, 2016 at 6:07 pm #695666Hi,
Work is in progress but this is taking quite some time, since you are using enfold we are happy to go an extra mile to fix this for you.
Please give us a little time while we update the result once it is done here.Best regards,
Vinay- This reply was modified 8 years, 1 month ago by Vinay.
October 5, 2016 at 6:37 pm #695698Hi,
Please review your site now. It took us a lot of time but we are happy to help you :)
We add the below css in Quick css
/* Responsive Header */ .main_menu { transform:translateX(-280px); } #header .avia-button-left { position: absolute; top: 54px; right: 150px; } #text-14.widget{ width:100%; max-width:1310px; } .seal { position:relative; float:right; right:0px; top:-10px; } .phone-number { position:absolute; z-index:999999!important; top:68px; right:610px; } @media only screen and (max-width: 1180px) { nav.main_menu {display:none !important;} #advanced_menu_toggle, #advanced_menu_hide {display:block !important; } .seal { right:90px; } #header .avia-button-left { right: 240px; } .phone-number { right:380px; }} @media only screen and (max-width: 930px) { .responsive .logo img { height: 80px!important; margin-top:30px; } } @media only screen and (max-width: 768px) { #header .avia-button-left { right: auto!important; left:200px; } .phone-number { left:0px; right:auto; } .seal { right:auto!important; left: 190px; float: left; } } @media only screen and (max-width: 480px) { .responsive .logo img, #header .avia-button-left , .seal { position:relative!important; right:auto!important; left:50%; transform:translateX(-50%); } .phone-number { position:absolute!important; top: 160px; right:auto; left: 50%; transform: translateX(-50%); } #header .avia-button-left { top:0} }
And the below css was conflicting with the responsive nature so we removed the below from styles.css
@media only screen and (max-width: 749px) { #header .widget { transform: none!important; } } #header .widget { padding-top: 0; position: absolute; left:80%; top: 23px; z-index: 999; } @media only screen and (max-width: 749px) { #header .widget { position: relative; padding-bottom: 0; top: 0px; left: 80%; } } @media only screen and (min-width: 750px) and (max-width: 1099px) { #header .widget { position: relative; padding-bottom: 0; top: 0px; left: 80%; } } /* == HIDE MENU ITEMS ON DESKTOP/MOBILE == */ @media only screen and (max-width: 1099px) { .hide-on-mobile { display: none !important; } } @media only screen and (min-width: 1099px) { .hide-on-desktop { display: none !important; }} /*0000000000*/ /* == CHANGE FONT & COLOR IN MAGAZINE ELEMENT must stay in quick css == */ .av-magazine .av-magazine-content-wrap .av-magazine-title { font-size: 22px; color: #305a91; } .av-magazine-title:hover { color: #80a7d8 !important; } /* == MAKE GREEN BOXES WHOLE IN MOBILE must stay in quick css == */ @media only screen and (max-width: 767px) { .responsive #top .container .av-content-small, .responsive #top #wrap_all .flex_column, .responsive #top #wrap_all .av-flex-cells .no_margin { margin-bottom: 0px; } } /* Fix footer for mobile */ @media only screen and (max-width: 670px) { .footer_color { background-size: cover; } #footer #text-11 { top: -50px; }} @media only screen and (max-width: 670px) { #footer #text-10 { top: 30px; }} /* == Fix spacing in icon list for small icons == */ .av-iconlist-small li { margin-bottom: 5px; } /* mobile menu extend to larger screens */ /* @media only screen and (max-width: 1099px) { nav.main_menu {display:none !important;} #advanced_menu_toggle, #advanced_menu_hide {display:block !important; } } @media only screen and (max-width: 749px) { #header .avia-button-left { transform: none!important; } } @media only screen and (max-width: 749px) { #header .#text-12 { transform: none!important; } } */ @media only screen and (max-width: 749px) { #header_meta { margin-top: -30px; } .logo img { margin: auto!important; } .logo { width: 100%!important; } #widget_sp_image-2 img{ transform:translate(50%, 20px); } } @media only screen and (min-width: 750px) and (max-width: 1099px) { #header_meta { margin-top: -30px; } .logo img { margin: auto!important; } .logo { width: 100%!important; } #widget_sp_image-2 img { transform:translate(50%, 20px); } } /* Mobile Menu Up Minimum Screen Size */ @media only screen and (max-width: 1199px) { nav.main_menu { display:none !important; } #advanced_menu_toggle, #advanced_menu_hide { display:block !important; } } /* Mobile Menu Positioning */ #advanced_menu_toggle { right: -25px; top: 30px; } /* Move Client Login button in header */ #header .avia-button-left { position: relative; top: -38px; left: 80%; } @media only screen and (max-width: 749px) { #header .avia-button-left { position: relative; padding-bottom: 0; top: -40px; left: 33%; } } @media only screen and (min-width: 750px) and (max-width: 1099px) { #header .avia-button-left { position: relative; padding-bottom: 0; padding-top: 0; top: -120px; left: 76%; } } /* move phone number widget */ #header #text-12 { position: relative; top: 112px; left: 18%; } @media only screen and (max-width: 749px) { #header #text-12 { position: relative; padding-bottom: 0; top: -20px; left: 23%; } } @media only screen and (min-width: 750px) and (max-width: 1099px) { #header #text-12 { position: relative; padding-bottom: 0; padding-top: 0; top: -100px; left: 66%; } }
Best regards,
VinayOctober 5, 2016 at 7:19 pm #695716I don’t understand. This looks nothing like it’s suppose to. All I asked was for help centering some header widgets in the mobile and tablet view. This has completely messed up the desktop view and is not even correct for the mobile or tablet views.
Desktop:
Mobile:
Tablet:
http://imgur.com/a/hbJGPThis is not right, please fix quickly, as I need this corrected ASAP!
October 5, 2016 at 11:07 pm #695801Please change it back – this is nowhere near correct!
October 6, 2016 at 12:02 am #695812Forget it, I’ll change it back!
October 6, 2016 at 2:53 am #695833Hi,
Thank you for sharing the screenshots. The site looked good on my end after removing the conflicting CSS and adding the new code. The conflicting CSS on your browser was cached and hence you were not able to see the changes properly. If you haven’t changed anything please try to hard refresh by pressing Ctrl + Shift + F5 on your browser or press the F12 key to open chrome dev tools and right click on the refresh button and select “Empty Cache and Hard Reload” and review the site again.
If you changed the code please revert the changes and get back to us if you have any questions.
Best regards,
VinayOctober 6, 2016 at 7:23 pm #696149I did flush all caches – Ctrl + F5 (no shift needed) – and it still was all wrong. Also checked using other browsers – same issue. So, after a lot of work figuring out what you had done and then correcting it, I got it changed back to the way it should look.
This has been one of the few times Kriesi support has disappointed me.
Please close this ticket.
October 6, 2016 at 7:46 pm #696154Hi,
With the new css code that was added everything was looking nice. I’m sorry that the changes were not visible on your end dude to caching issue.
I din’t take screenshots in the hurry but I’m sure you would be happy with the way the header looked. However I’m glad it’s sorted for you now :)
Please feel free to get in touch with us via new ticket if you have any questions.Best regards,
Vinay -
AuthorPosts
- The topic ‘Center Header Widgets in Mobile’ is closed to new replies.