Topic: Divs and alignment

Hi,

I'm having problems with my alignment. When the width and height is set to 100% then it aligns to the centre fine.

However, when I change the size to 80% width and height it aligns left and I can't fix it.

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "100%", "100%", "transparent", true);
});
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->

I don't understand what the "sv-container" div does. Because it does not wrap around the script and it contains nothing. I've tried making an id rule "#sv-container" and edited the properties but it doesn't affect the simple viewer at all. So I can't centre it this way.

I also tried adding <div id="sv-container" div align="center"></div> and this doesn't work.

Could someone please explain what the sv-container div is for and how I can contain the player within a div and then align it.

Thank you!

Re: Divs and alignment

The first Embed Code Parameter of following line is the divId, ie. the id of the HTML div to replace with the gallery:

simpleviewer.load("sv-container", "100%", "100%", "transparent", true);

Therefore, the line:

<div id="sv-container"></div>

... is essential for the gallery to be displayed on the page.

In order to horizontally center the 'sv-container' <div>, replace:

<div id="sv-container"></div>

... with:

<div id="sv-container" style="margin: 0 auto;"></div>
Steven Speirs
SimpleViewer Support Team.

Re: Divs and alignment

Hi Steven

Thank you for your explanation!

This solved my problem   smile