Page 1 of 1

Centre widget html

Posted: Fri Aug 03, 2012 12:06 am
by PernicketyPete
Hi All
How can i get my widget to display in the middle of the page? instead of the default "left" position.

Many Thanks Pete.

Re: Centre widget html

Posted: Fri Aug 03, 2012 5:49 am
by hermanz
Hi Pete :good:
Can You tell us more.

Is this for a website etc.


gr.
Herman :beer:

Re: Centre widget html

Posted: Fri Aug 03, 2012 7:12 am
by par
Hey, Pete!
Can you give a link to your page with YoWindow widget installed?

Re: Centre widget html

Posted: Fri Aug 03, 2012 8:15 am
by PernicketyPete
Hi Par & Herman
Thanks for getting back to me.
Yes this is for my website. I would like to display my Yowindow widget in the centre of the web page, when the page is first loaded. At the moment my widget loads on the left of the page. I have tried the usual < p align="centre"> in various places in the widget code, but I can't manage to get it to work so that it will load in the centre of the page. How can I do this?

Par, how will the link help to load my widget in the centre of the page?

Thanks Pete.

Re: Centre widget html

Posted: Fri Aug 03, 2012 8:27 am
by ikarus1969
Hi Pete!

In case it's not a typo try

Code: Select all

<p align="center">
instead of
PernicketyPete wrote:...< p align="centre">
PernicketyPete wrote:Par, how will the link help to load my widget in the centre of the page?
The link to your webpage will allow us to have a look at the html source-code of your page and see what's eventually missing, what's coded not correctly.

Re: Centre widget html

Posted: Fri Aug 03, 2012 9:59 am
by PernicketyPete
Hi
Here is the link to my widget http://www.chilthorneweather.co.uk/yowindow_widget.html

Thanks Pete

Re: Centre widget html

Posted: Fri Aug 03, 2012 10:12 am
by par
Unfortunately <p align="center"> will not work in this case.

You need to wrap widget code inside the following <div> tag

Code: Select all

<div style="width:440px; margin-left: auto;  margin-right: auto;">  
</div>
This is a standard approach in CSS.
This article explains why.
http://www.thesitewizard.com/css/center-div-block.shtml

Re: Centre widget html

Posted: Fri Aug 03, 2012 10:26 am
by ikarus1969
par wrote:Unfortunately <p align="center"> will not work in this case.

You need to wrap widget code inside the following <div> tag

Code: Select all

<div style="width:440px; margin-left: auto;  margin-right: auto;">  
</div>
This is a standard approach in CSS.
This article explains why.
http://www.thesitewizard.com/css/center-div-block.shtml
Thanks! :wink:

Re: Centre widget html

Posted: Fri Aug 03, 2012 12:55 pm
by hermanz
Hi Pete

Here is the code in the zip file

succes
Herman :beer:

Re: Centre widget html

Posted: Fri Aug 03, 2012 2:55 pm
by PernicketyPete
Thanks Par & Everyone
That's it. I have it sorted.

Many thanks for all your help Pete.