Jump to content
Sign in to follow this  
cfisher

Image Alignment In Widgets?

Recommended Posts

cfisher    0
cfisher

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
Andrew    201
Andrew

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
cfisher    0
cfisher

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
cmunns    16
cmunns

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
cfisher    0
cfisher

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
catrina    103
catrina

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.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
cfisher    0
cfisher

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
bryan-hadaway    3
bryan-hadaway

Yes, that code is deprecated. Instead use: `

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

Share this post


Link to post
Share on other sites
cfisher    0
cfisher

Thanks! That rocks!! Exactly what I needed!

Share this post


Link to post
Share on other sites
cfisher    0
cfisher

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
cfisher    0
cfisher

Any suggestions would be greatly appreciated.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×