MyBB Community Forums

Full Version: Need to center this thing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
If there's a table inside the pw_adbox_56704_6_0 id, then you can style it with CSS. Put the following before it:

<style>
	#pw_adbox_56704_6_0 table {
		margin-left: auto;
		margin-right: auto;
	}
	</style>
(2011-05-30, 06:38 PM)faviouz Wrote: [ -> ]If there's a table inside the pw_adbox_56704_6_0 id, then you can style it with CSS. Put the following before it:

<style>
	#pw_adbox_56704_6_0 table {
		margin-left: auto;
		margin-right: auto;
	}
</style>

Then this should work, right?
<style>
	#pw_adbox_56704_6_0 table {
		margin-left: auto;
		margin-right: auto;
		float:none !important;
	}
	</style>
(2011-05-30, 06:38 PM)Aries-Belgium Wrote: [ -> ]There are two main issues here: you need to give a width to the span (although a div would be better) directly under div.navigation and I also think that the ad script adds a float left to the div#pw_adbox_56549_2_0. If you float an element the element will be become an inline element and it will automatically fit his width to the content.

If you give your first floated span (or div) a width, somehow remove the float on that #pw_adbox_... div and give margin: 0px auto; to the table, it is centered. Of course when working with generated code, you are always limited in what you can do.
Could you give me some code to try for that?
(2011-05-30, 06:38 PM)faviouz Wrote: [ -> ]If there's a table inside the pw_adbox_56704_6_0 id, then you can style it with CSS. Put the following before it:

<style>
	#pw_adbox_56704_6_0 table {
		margin-left: auto;
		margin-right: auto;
	}
	</style>
(2011-05-30, 06:44 PM)Sama34 Wrote: [ -> ]
(2011-05-30, 06:38 PM)faviouz Wrote: [ -> ]If there's a table inside the pw_adbox_56704_6_0 id, then you can style it with CSS. Put the following before it:

<style>
	#pw_adbox_56704_6_0 table {
		margin-left: auto;
		margin-right: auto;
	}
</style>

Then this should work, right?
<style>
	#pw_adbox_56704_6_0 table {
		margin-left: auto;
		margin-right: auto;
		float:none !important;
	}
	</style>

Didn't work Sad
@faviouz: that should work although the problem is that two parent elements are floated which means that those will automatically size to the width of the table so the margins aren't going to have much effect. I also think the numbers of the adbox is always different. I, for instance, had another number.
(2011-05-30, 06:51 PM)Aries-Belgium Wrote: [ -> ]@faviouz: that should work although the problem is that two parent elements are floated which means that those will automatically size to the width of the table so the margins aren't going to have much effect. I also think the numbers of the adbox is always different. I, for instance, had another number.

Are you talking about the adbox code? That number is unique to that ad and won't change.
Okay, this works for me locally. Can you give the class "adbox" to the span directly under div.navigation instead of style="float:left"? If done, put this in your global.css:
.adbox {
	float:left;
	width: 80%;
}

.adbox *
{
	float: none !important;
}

.adbox table
{
	margin: 0px auto;
}
(2011-05-30, 07:02 PM)Aries-Belgium Wrote: [ -> ]Okay, this works for me locally. Can you give the class "adbox" to the span directly under div.navigation instead of style="float:left"? If done, put this in your global.css:
.adbox {
	float:left;
	width: 80%;
}

.adbox *
{
	float: none !important;
}

.adbox table
{
	margin: 0px auto;
}

Well it's added to global.css.

I didn't quite understand what you meant, did I do it right?
<div class="navigation"><div class="adbox"><center><!-- Project Wonderful Ad Box Code -->
<div id="pw_adbox_56704_6_0"></div>
<!-- End Project Wonderful Ad Box Code --></center></div></div>
(2011-05-30, 07:09 PM)lucasbytegenius Wrote: [ -> ]I didn't quite understand what you meant, did I do it right?
<div class="navigation"><div class="adbox"><center><!-- Project Wonderful Ad Box Code -->
<div id="pw_adbox_56704_6_0"></div>
<!-- End Project Wonderful Ad Box Code --></center></div></div>


Yes, but without the center tags
(2011-05-30, 07:11 PM)Aries-Belgium Wrote: [ -> ]
(2011-05-30, 07:09 PM)lucasbytegenius Wrote: [ -> ]I didn't quite understand what you meant, did I do it right?
<div class="navigation"><div class="adbox"><center><!-- Project Wonderful Ad Box Code -->
<div id="pw_adbox_56704_6_0"></div>
<!-- End Project Wonderful Ad Box Code --></center></div></div>


Yes, but without the center tags

Didn't work, and now it's showing up the same way it does in Chrome under Opera and Firefox.
Are you doing this on another website than enigmachs.com? Because I don't see any changes you made Smile

If you PM me logins for an admin account I will see if I can fix it for you.
Pages: 1 2 3 4