Jump to content


Photo

Image Alignment In Widgets?


This topic has been archived. This means that you cannot reply to this topic.
10 replies to this topic

#1 cfisher

cfisher

    Super Member

  • Members
  • PipPipPipPip
  • 112 posts

Posted 01 August 2010 - 04:43 PM

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.

#2 arpowers

arpowers

    Founder

  • Administrators
  • 3271 posts

Posted 02 August 2010 - 12:39 AM

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 :)

#3 cfisher

cfisher

    Super Member

  • Members
  • PipPipPipPip
  • 112 posts

Posted 02 August 2010 - 12:36 PM

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):

Posted Image

#4 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts

Posted 02 August 2010 - 04:32 PM

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.

#5 cfisher

cfisher

    Super Member

  • Members
  • PipPipPipPip
  • 112 posts

Posted 20 November 2010 - 04:30 PM

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?

#6 catrina

catrina

    Advocate

  • Members
  • 12345 posts

Posted 20 November 2010 - 06:25 PM

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.

#7 cfisher

cfisher

    Super Member

  • Members
  • PipPipPipPip
  • 112 posts

Posted 23 November 2010 - 11:33 PM

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?

#8 bryan-hadaway

bryan-hadaway

    Advocate

  • Members
  • PipPipPipPipPip
  • 3697 posts

Posted 24 November 2010 - 02:25 PM

Yes, that code is deprecated. Instead use: `
... code, text, images, whatever ...
` Thanks, Bryan

#9 cfisher

cfisher

    Super Member

  • Members
  • PipPipPipPip
  • 112 posts

Posted 24 November 2010 - 07:16 PM

Thanks! That rocks!! Exactly what I needed!

#10 cfisher

cfisher

    Super Member

  • Members
  • PipPipPipPip
  • 112 posts

Posted 12 December 2010 - 06:10 PM

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!).

#11 cfisher

cfisher

    Super Member

  • Members
  • PipPipPipPip
  • 112 posts

Posted 16 December 2010 - 04:21 PM

Any suggestions would be greatly appreciated.