Jump to content

Need Help With My Website

NInety
Go to solution Solved by OrangeFlavoured,

Put it inside a div with a unique ID attribute, then in your CSS, do 

text-align: center;

Or,

margin-left: auto;margin-right: auto;

I want to embed my Twitch.tv player from my channel on my website, I can do it, but the player isn't centered. How can I center it?

 

https://sites.google.com/site/therainingpixel/

 

The code:

<object xmlns="http://www.w3.org/1999/xhtml" bgcolor="#000000" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=therainingpixel" height="378" id="live_embed_player_flash" type="application/x-shockwave-flash" width="620"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" /><param name="flashvars" value="hostname=www.twitch.tv&channel=therainingpixel&auto_play=true&start_volume=25" /></object>
Link to comment
Share on other sites

Link to post
Share on other sites

Could put it in a div and center it using CSS. Probably not the best solution, but doable.

Link to comment
Share on other sites

Link to post
Share on other sites

Put it inside a div with a unique ID attribute, then in your CSS, do 

text-align: center;

Or,

margin-left: auto;margin-right: auto;

Roses are red, violets are blue, computers are awesome, and so are you!

Link to comment
Share on other sites

Link to post
Share on other sites

 

Put it inside a div with a unique ID attribute, then in your CSS, do 

text-align: center;

Or,

margin-left: auto;margin-right: auto;

would margin: 0 auto; work as well, 1 less line!

 

@Raining_Pixel

also what are you trying to do to yourself on may 20th, 2015!? Kill yourself!?

over 70 hours a week of skyrim, are you insane  :huh:

Link to comment
Share on other sites

Link to post
Share on other sites

would margin: 0 auto; work as well, 1 less line!

 

also what are you trying to do to yourself on may 20th, 2015!? Kill yourself!?

over 70 hours a week of skyrim, are you insane  :huh:

It would probably work ( I haven't testing it) but it would be bad because you are setting the top margin to 0 (which may counteract other settings) and then only setting the right. Bad Idea.

 

I have no idea what you are talking about in the 2nd paragraph...

Roses are red, violets are blue, computers are awesome, and so are you!

Link to comment
Share on other sites

Link to post
Share on other sites

you can put <center> at the beginning of the code and then </center> at the end also if you want to make the code even cleaner.

 

For example <center>This text will be center-aligned.</center>

Link to comment
Share on other sites

Link to post
Share on other sites

It would probably work ( I haven't testing it) but it would be bad because you are setting the top margin to 0 (which may counteract other settings) and then only setting the right. Bad Idea.

 

I have no idea what you are talking about in the 2nd paragraph...

the second paragraph was about in the op's website in the on his twitch channel he says he's going to play skyrim everyday for hours on end.

Link to comment
Share on other sites

Link to post
Share on other sites

the second paragraph was about in the op's website in the on his twitch channel he says he's going to play skyrim everyday for hours on end.

Oh OK, I didn't understand cause you said it while quoting my reply :P

Roses are red, violets are blue, computers are awesome, and so are you!

Link to comment
Share on other sites

Link to post
Share on other sites

you can put at the beginning of the code and then at the end also if you want to make the code even cleaner.

 

For example This text will be center-aligned.

Actually the center tag is deprecated, and is considered bad practise

The CSS solution is to prefer

Link to comment
Share on other sites

Link to post
Share on other sites

Actually the center tag is deprecated, and is considered bad practise

The CSS solution is to prefer

 

This is the case with all formatting, I believe. HTML should no longer be used for any of that. HTML is purely for content flow/structure... CSS does the Look and Feel...

Link to comment
Share on other sites

Link to post
Share on other sites

would margin: 0 auto; work as well, 1 less line!

 

@Raining_Pixel

also what are you trying to do to yourself on may 20th, 2015!? Kill yourself!?

over 70 hours a week of skyrim, are you insane  :huh:

Can't get enough Skyrim. ;)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×