I am trying to center align the announcements web part on my Sharepoint 2010 page, everything I try to do just centers the text, not the web part. Is it even possible to change the alignment from left or is it a limitation of SharePoint?
Thanks
This is usually what I do for most of my webpart, you might have to adjust the selector for the web part you have but it should work right off the bat.
<style>
.s4-wpTopTable {
margin-left: auto;
margin-right: auto;
}
</style>
Just copy the following code into a CEWP on your page.
@Simon - I don't have enough reputation to comment, but "copy code into CEWP" would mean copying the code into a Content Editor Web Part. This web part can be added to the page just like any other web part, via "Edit Page" (in the Page ribbon), then click one of the "Add Web Part" links on the page or use the "Web Part" button on the Insert ribbon at the top. Choose "Content Editor Web Part" from the list (in the Media/Content category). Then, select the web part, then click the "Edit Source" button in the ribbon, and finally, paste in the code. You can optionally set the web part to hidden as well in the web part's properties. Apply the changes to the web part, then save the page and you should be all set.
Alternatively, you could accomplish the same by editing the page in SharePoint Designer and adding the code manually. CEWPs sometimes work well and sometimes not in my experience; it depends what you want to do. For something simple like adding a style block it should work alright.