Archived

This topic is now archived and is closed to further replies.

  • 0

Image Alignment In Widgets?

Question

Posted · Report post

This is isn't bug, but more a question due to my own ignorance about customizing code. I thought maybe the Pagelines community might have some help suggestions for this: Is there a way to have images generated from javascript (e.g., Google Admanager scripts, etc.) to center nicely within a widget? Currently they align top left within widgets.

Share this post


Link to post
Share on other sites

10 answers to this question

Posted · Report post

Any suggestions would be greatly appreciated.

Share this post


Link to post
Share on other sites

Posted · Report post

This center div style code you gave me has worked fantastic Bryan: `

... code, text, images, whatever ...
` Solved many, many layout problems for me. One question. Is is possible to add padding to the top and/or bottom of this code? I was not sure if I can add code since this appears to call from my CSS style sheet. If I can add padding, what would the code look like? (Sorry for my code illiteracy!).

Share this post


Link to post
Share on other sites

Posted · Report post

Yes, you can usually center images... I don't know what you mean about the generated images though. We will probably need to add some custom css to give you the presentation you're looking for.. Post a link/mockup of where your having the issue and what you want to see :)

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks for offering to help. Basically images that are generated from javascript calls, such as from Google Adsense, do not center in the widget. It doesn't look terrible, but could definitely look better. Here is a screen shot (notice the image is aligned top left): widget-screenshot.jpg

Share this post


Link to post
Share on other sites

Posted · Report post

text-align:center will do the trick but you'll have to assign it to specific widgets so that it doesn't shift the text in other widgets. For example of the widgets on your site that it will fix... `#text-3 .widget {text-align:center;}` If you have never used firebug for firefox I recommend it or view the source and find the class/id for the appropriate widgets that way.

Share this post


Link to post
Share on other sites

Posted · Report post

I picked up a tip on online to simply enclosed the javascript in old school HTML `

`. It worked great. Any reason from a coding standpoint I wouldn't want to do this?

Share this post


Link to post
Share on other sites

Posted · Report post

Yes, that code is deprecated. Instead use: `

... code, text, images, whatever ...
` Thanks, Bryan

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks! That rocks!! Exactly what I needed!

Share this post


Link to post
Share on other sites

Posted · Report post

Sorry for the very delayed response to this. I still need to implement this. Where exactly would I place this code? I assume I'd add it the theme stylesheet? And how would I add it to the text widget that contains the image call?

Share this post


Link to post
Share on other sites

Posted · Report post

Add the code to the custom CSS box in your theme settings. You wouldn't have to add it to the text widget with the widget call.

Share this post


Link to post
Share on other sites