Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Footer Widget Issue!

Featured Replies

Hi all,

 

I've been tearing my hair out trying to fix this seemingly basic CSS issue. The footer area of my clients Wordpress website here: http://hrbims.com/ is not behaving as I would like it to. I am using a child theme with the twentythirteen theme as the parent.

Basically there is 3 widgets in the footer which I want to be full-width, however whenever I increase the widget width using the following CSS the widgets stack vertically instead of staying horizontal:

 

.sidebar .site-footer .widget {
     width: 275px; //anything 250px or above causes the stacking
}
 

The widget area container is 900px and there is no padding around the widgets so there should be plenty of space for the widgets to be full-width.

The really weird thing is when I use the CSS from above in the Chrome Inpsector tool the stacking doesnt occur, it only happens when I actually add the code to the stylesheet and upload it.

 

Would REALLY appreciate your help on this one guys!!

 

 

cheers,

 

Andy

Edited by AndyDesigns

An unknown element may render as display: inline; by default. I think that's the issue here, because you're nested quite far down, using different tags, it's getting confused as to which display model it should be using.

 

It could also be that an ID (which has more weight than a class) is overriding something.

 

Try adding display: block; to .sidebar .site-footer .widget {}.

Also, using absolute positioning probably won't do you any favors here. You can align these elements naturally. I would consider re-writing this bit to avoid confusion, there's a lot of classes being used.

 

http://jsfiddle.net/J7UQ2/

 

http://jsfiddle.net/J7UQ2/embedded/result/

  • Author

Also, using absolute positioning probably won't do you any favors here. You can align these elements naturally. I would consider re-writing this bit to avoid confusion, there's a lot of classes being used.

 

http://jsfiddle.net/J7UQ2/

 

http://jsfiddle.net/J7UQ2/embedded/result/

 

Thankyou for all your help Jack, i'm beginning to regret using this theme as a starting point now, because as you say it has alot of confusing classes in the footer.

I've tried adding the following code that you suggested below but i'm still having problems:

 

footer aside  {
    margin-right: 0;
    padding-right: 0;
    padding-left:0;
    color: #3f3f3f;
    display: inline-block;
    width: 275px !important;
}
 

 

The absolute positioning is an inline-style which seems to be generated by the widget so not sure how I can remove that. Any further advice much appreciated.

Edited by AndyDesigns

The last bit of code in your functions js are causing it to display vertical if you comment that out and then change the max width to 900px on .sidebar .sitefooter .widget-area{} see where that gets you

 

this is what wants commenting out

 

/**
	 * Arranges footer widgets vertically.
	 */
	/*if ( $.isFunction( $.fn.masonry ) ) {
		var columnWidth = body.is( '.sidebar' ) ? 228 : 245;

		$( '#secondary .widget-area' ).masonry( {
			itemSelector: '.widget',
			columnWidth: columnWidth,
			gutterWidth: 20,
			isRTL: body.is( '.rtl' )
		} );
	}*/

I may have miss-read what you wanted if you want them stacked full width do as above but also remove float from .site-footer .widget {} then either remove

 

footer aside  {
    margin-right: 0;
    padding-right: 0;
    padding-left:0;
    color: #3f3f3f;
    display: inline-block;
    width: 275px !important;
}

and change .sidebar .site-footer .widget {} to 900px or change the above width to 900px

 

hth I wasn't sure if you wanted them side by side or stacked

  • Author

Thankyou so much!!! You were right with your first reply, the js was the culprit. I dont understand when I first activated the twentythirteen theme the footer was behaving as I wanted but since using my child-theme then the problems started. If possible I would like to connect the top and bottom borders of the headings to each other to make one long double-border.

Will have a play with the CSS.

 

Once again, thankyou so much!!! :good:

Edited by AndyDesigns

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.