Someone else may have a more clever idea, but I would just enclose the  
script in a div and center that.

<div style='width:450px; height:150px; margin:0 auto;'>(put script  
here)</div>


Some will recommend keeping your css elsewhere, so you could also add  
this to your css:
. twitter {width:450px; height:150px; margin:0 auto;}

And then add this to your html:
<div class="twitter">(put script here)</div>

Hope that helps,
-Delos

On Dec 22, 2009, at 3:59 PM, Dagmar Noll wrote:

> I'm trying to embed the Twitter profile widget in my webpage. It's a
> <script></script> item and I just want it centered on the page using
> css. It seems to be immune to all css styling. Text in the same div
> centers when I put text-align:center in the css file, but this stays
> smack against the left side of the div. I tried putting the script  
> in a
> set of <p></p> tags. That didn't work, either.
>
> I don't understand what I am doing wrong. I have never had a script  
> in a
> web page before, so perhaps I am not understanding the nature of
> <script> tags. I wen to wc3 and read some of the documents about
> centering and scripts and didn't find anything illuminating.
>
> If it helps, this is the script:
>
> <script src="http://widgets.twimg.com/j/2/widget.js";></script>
> <script>
> new TWTR.Widget({
>   version: 2,
>   type: 'profile',
>   rpp: 3,
>   interval: 6000,
>   width: 450,
>   height: 150,
>   theme: {
>     shell: {
>       background: '#006600',
>       color: '#ffffff'
>     },
>     tweets: {
>       background: '#333333',
>       color: '#ffffff',
>       links: '#99cc66'
>     }
>   },
>   features: {
>     scrollbar: true,
>     loop: false,
>     live: false,
>     hashtags: true,
>     timestamp: true,
>     avatars: false,
>     behavior: 'all'
>   }
> }).render().setUser('WindhamRegCERT').start();
> </script>
>
> Thanks for considering my issue.
>
> Dagmar
> ______________________________________________________________________
> css-discuss [[email protected]]
> http://www.css-discuss.org/mailman/listinfo/css-d
> List wiki/FAQ -- http://css-discuss.incutio.com/
> List policies -- http://css-discuss.org/policies.html
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to