Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 03-15-2012, 08:00 PM   #1
Solid State Member
 
Join Date: Feb 2012
Location: United States
Posts: 15
Default How to center a poll on website?

EDIT:

This is what I have, and I cannot figure out how to center it on my webpage (as a whole without distorting it). Any ideas?
Code:
 <div id="container">
			<div id="left">
				<div id="poll-container">
					<h3>GOP Poll</h3>
					<form id='poll' action="poll.php" method="post" accept-charset="utf-8">
						<p>Choose your favorite GOP candidate:</p><p>
						<input type="radio" name="poll" value="opt1" id="opt1" /><label for='opt1'>&nbsp;option1</label><br />
						<input type="radio" name="poll" value="opt2" id="opt2" /><label for='opt2'>&nbsp;option2</label><br />
						<input type="radio" name="poll" value="opt3" id="opt3" /><label for='opt3'>&nbsp;option3</label><br />
						<input type="radio" name="poll" value="opt4" id="opt4" /><label for='opt4'>&nbsp;option4</label><br />
						<input type="submit" value="Vote &rarr;" /></p>
					</form>
				</div>
			</div>
		</div>
__________________

Mike Anthony is offline   Reply With Quote
Old 03-15-2012, 11:42 PM   #2
Daemon Poster
 
wmorri's Avatar
 
Join Date: May 2007
Posts: 1,066
Send a message via AIM to wmorri
Default Re: How to center a poll on website?

Hi,

Can you post your html and css so we can see what you are writen? Then we can work on a fix for you.
__________________

__________________
LEARN BY DOING NOT BY FOLLOWING DIRECTIONS!
Linux Forever!

I thought you were a hispanic/african american? Who is the white guy in the pictures?
wmorri is offline   Reply With Quote
Old 03-16-2012, 08:06 AM   #3
Solid State Member
 
Join Date: Feb 2012
Location: United States
Posts: 15
Default Re: How to center a poll on website?

I'll get that to you after work today.

I don't have any CSS written yet, just background-color:.

I have several different div elements making up the poll. Like the background of it, the question, the 4 different choices, the dots for selecting your answer. I just need to find out if there is a way to move that whole group as like a block without changing the position of all the elements within the poll.
Mike Anthony is offline   Reply With Quote
Old 03-16-2012, 04:26 PM   #4
Solid State Member
 
Join Date: Feb 2012
Location: United States
Posts: 15
Default Re: How to center a poll on website?

updated post
Mike Anthony is offline   Reply With Quote
Old 03-16-2012, 05:46 PM   #5
Wizard of Wires
 
setishock's Avatar
 
Join Date: Feb 2005
Location: Not sure
Posts: 10,030
Default Re: How to center a poll on website?

At the start of the poll's opening div put the html opening center. At the very end of the poll close it. It's going to stack it so watch how it does it and see if that's what you want.
setishock is offline   Reply With Quote
Old 03-16-2012, 05:53 PM   #6
Daemon Poster
 
wmorri's Avatar
 
Join Date: May 2007
Posts: 1,066
Send a message via AIM to wmorri
Default Re: How to center a poll on website?

Hi,

Are you using a WISIWIG program to help you create this site, because you divs look like they are made from a list, not from names that you made up?
__________________
LEARN BY DOING NOT BY FOLLOWING DIRECTIONS!
Linux Forever!

I thought you were a hispanic/african american? Who is the white guy in the pictures?
wmorri is offline   Reply With Quote
Old 03-16-2012, 05:57 PM   #7
Solid State Member
 
Join Date: Feb 2012
Location: United States
Posts: 15
Default Re: How to center a poll on website?

Quote:
Originally Posted by setishock View Post
At the start of the poll's opening div put the html opening center. At the very end of the poll close it. It's going to stack it so watch how it does it and see if that's what you want.
I tried that, it didn't work.

Quote:
Originally Posted by wmorri View Post
Hi,

Are you using a WISIWIG program to help you create this site, because you divs look like they are made from a list, not from names that you made up?
I am using dreamweaver. I got the layout for the poll off a generator online, then studied the code and changed it to better fit what I wanted.

Although I think I found a way to make a poll a different way.
Mike Anthony is offline   Reply With Quote
Old 03-17-2012, 03:12 PM   #8
Solid State Member
 
Join Date: Feb 2012
Location: United States
Posts: 15
Default Re: How to center a poll on website?

Updated OP. I can't figure it out.
Mike Anthony is offline   Reply With Quote
Old 03-19-2012, 11:16 PM   #9
Baseband Member
 
Join Date: Feb 2012
Location: United States
Posts: 28
Default Re: How to center a poll on website?

Let me help take a look at my poll ----- lol, take a look at my poll, sorry the 13 year old boy in me is acting out again!

J & L Custom PC Poll

Here is my code

Code:
<div class="content"><center><form method="post" action="http://poll.pollcode.com/3490"><table border=0 width=401 bgcolor="EEEEEE" cellspacing=2 cellpadding=0><tr><td colspan=2><font face="Verdana" size=-1 color="000000"><b>What are you willing to spend on a new PC?</b></font></td></tr><tr><td width=22><input type=radio name=answer value="1" id="answer1"></td><td width="373"><font face="Verdana" size=-1 color="000000"><label for="answer1">$200 - $400</label></font></td></tr><tr><td width=22><input type=radio name=answer value="2" id="answer2"></td><td><font face="Verdana" size=-1 color="000000"><label for="answer2">$400 - $600</label></font></td></tr><tr><td width=22><input type=radio name=answer value="3" id="answer3"></td><td><font face="Verdana" size=-1 color="000000"><label for="answer3">$600 - $800</label></font></td></tr><tr><td width=22><input type=radio name=answer value="4" id="answer4"></td><td><font face="Verdana" size=-1 color="000000"><label for="answer4">$800 - $1000</label></font></td></tr><tr><td width=22><input type=radio name=answer value="5" id="answer5"></td><td><font face="Verdana" size=-1 color="000000"><label for="answer5">$1000 - $1200</label></font></td></tr><tr><td width=22><input type=radio name=answer value="6" id="answer6"></td><td><font face="Verdana" size=-1 color="000000"><label for="answer6">$1200 - $1400</label></font></td></tr><tr><td width=22><input type=radio name=answer value="7" id="answer7"></td><td><font face="Verdana" size=-1 color="000000"><label for="answer7">$1400 - $1800</label></font></td></tr><tr><td width=22><input type=radio name=answer value="8" id="answer8"></td><td><font face="Verdana" size=-1 color="000000"><label for="answer8">$1800 or more</label></font></td></tr><tr><td colspan=2><center><input type=submit value="Vote">&nbsp;&nbsp;<input type=submit name=view value="View"></center></td></tr><tr><td colspan=2 align=right><font face="Verdana" size=-2 color="black">pollcode.com <a href=http://pollcode.com/>free polls</a>&nbsp;</font></td></tr></table></form>
</center>

</div>


---------- Post added at 11:15 PM ---------- Previous post was at 11:12 PM ----------

Quote:
Originally Posted by Mike Anthony View Post
EDIT:

This is what I have, and I cannot figure out how to center it on my webpage (as a whole without distorting it). Any ideas?
Code:
 <div id="container">
			<div id="left">
				<div id="poll-container">
					<h3>GOP Poll</h3>
					<form id='poll' action="poll.php" method="post" accept-charset="utf-8">
						<p>Choose your favorite GOP candidate:</p><p>
						<input type="radio" name="poll" value="opt1" id="opt1" /><label for='opt1'>&nbsp;option1</label><br />
						<input type="radio" name="poll" value="opt2" id="opt2" /><label for='opt2'>&nbsp;option2</label><br />
						<input type="radio" name="poll" value="opt3" id="opt3" /><label for='opt3'>&nbsp;option3</label><br />
						<input type="radio" name="poll" value="opt4" id="opt4" /><label for='opt4'>&nbsp;option4</label><br />
						<input type="submit" value="Vote &rarr;" /></p>
					</form>
				</div>
			</div>
		</div>
Here is your code and i fixed it

Code:
<div id="container">
			<div id="center">
				<div id="poll-container">
					<h3>GOP Poll</h3>
					<form id='poll' action="poll.php" method="post" accept-charset="utf-8">
						<p align="center">Choose your favorite GOP candidate:</p><p align="center">
						<input type="radio" name="poll" value="opt1" id="opt1" /><label for='opt1'>&nbsp;option1</label><br />
						<input type="radio" name="poll" value="opt2" id="opt2" /><label for='opt2'>&nbsp;option2</label><br />
						<input type="radio" name="poll" value="opt3" id="opt3" /><label for='opt3'>&nbsp;option3</label><br />
						<input type="radio" name="poll" value="opt4" id="opt4" /><label for='opt4'>&nbsp;option4</label><br />
						<input type="submit" value="Vote &rarr;" /></p>
					</form>
				</div>
			</div>
		</div>


---------- Post added at 11:16 PM ---------- Previous post was at 11:15 PM ----------

I miss read your post you want to move it and leave the alignment intact but center a sa whole..........let me fix that one moment.


Ok so in order to fix the centering without messing with the format, its a bit of a trick!

You need to wrap the code inside a apdiv tag that is centered and then center a tag within it and place your code.

Code:
<style type="text/css">
#apDiv1 {
	position:relative;
	width:293px;
	height:314px;
	z-index:1;
	top: 136px;
	margin: auto;
}
#apDiv2 {
	position:relative;
	width:221px;
	height:249px;
	z-index:2;
	margin: auto;
}
</style>
</head>

<body>
   <div id="apDiv1"><div id="apDiv2"><h3>GOP Poll</h3>
					<form id='poll' action="poll.php" method="post" accept-charset="utf-8">
						<p>Choose your favorite GOP candidate:</p><p>
						<input type="radio" name="poll" value="opt1" id="opt1" /><label for='opt1'>&nbsp;option1</label><br />
						<input type="radio" name="poll" value="opt2" id="opt2" /><label for='opt2'>&nbsp;option2</label><br />
						<input type="radio" name="poll" value="opt3" id="opt3" /><label for='opt3'>&nbsp;option3</label><br />
						<input type="radio" name="poll" value="opt4" id="opt4" /><label for='opt4'>&nbsp;option4</label><br />
						<input type="submit" value="Vote &rarr;" /></p>
					</form>
 </div>
 </div>
you will need to rename the apdiv elements to match the number or lettering you use in your code.

If this is not enough of an explanation let me know

webmaster@jlcustompc.com

you can take a look at what it would look like live here

http://www.jlcustompc.com/testpollforcomputerforums.php
jlcpcnc is offline   Reply With Quote
Old 05-02-2012, 02:20 PM   #10
Baseband Member
 
engrmudasir's Avatar
 
Join Date: Dec 2011
Location: Pakistan
Posts: 23
Default Re: How to center a poll on website?

make them dynamic dear
__________________

engrmudasir is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 12:58 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0