HTML - Cant Get A Script To Center
Hi guys,
Sorry if this is a stupid question, but I am having problems with a little script that keeps being left aligned no matter what I do. Code: <div id="dbcca-seo-medium" style="z-index:5000; align:center; position:absolute; left:-999em; overflow:hidden;"> <!-- For Search Engine Spiders --> <h1> www.know-the-number.com</h1> <p style="text-align: center; "> <a href="http://www.know-the-number.com">Our Climate is Changing!</a></p> </div> <script src="http://www.dbcca.com/dbcca/EN/_js/home/swfobject.js" type="text/javascript"></script><script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script><script type="text/javascript">try{var pageTracker = _gat._getTracker("UA-1825898-14"); pageTracker._setDomainName("none"); pageTracker._setAllowLinker(true); pageTracker._trackPageview();} catch(err) {}</script><script type="text/javascript">swfobject.embedSWF("http://www.dbcca.com/dbcca/EN/_swf/embed-widget.swf", "dbcca-medium", "419", "132", "9.0.0", "", {},{wmode:'transparent',base:'http://www.dbcca.com'},{});</script> <p> </p> <div id="dbcca-medium" style="text-align: center; "> Please download <a href="https://www.adobe.com/go/getflashplayer/">Flash Player</a>.</div> Can anyone please tell me what to do to get it to center please. Thanks a million in advance! Similar TutorialsI have several div tags that I want exactly where I place them regardless of a user's screen size / resolution ... if I place them right of left 200 px then they shfit depending on resolution ... samve if I place them right of left by, say 85%. I'm figuring if I place the div tage left of center or right of center then they will always position correctly because the center doesn't vary according to resolution. How do I do this? I tried document.getElementById("divid").style.center = "25"; (i was attempting 25 pixels right of center) but it doesn't work. Any suggestions? Thanks! I have a webpage with a header, column on each side, footer and a mainContainer in the middle. I would like to set up links on the left column that, when clicked, open a new 'page' in the center (mainContainer). I am using all div tags, no tables. Could someone point me in the right direction? TIA I am administering this forum www.br-eeze.com So please enter there as the flashing banner and the weather widgets. Both are positioned on the left. Now this is the code for the banner: <td align="center" valign="top" width="90" height="55"><A target = "_blank" HREF="http://www.br-eeze.com"><IMG SRC="http://www.xxx.com/test1.gif" border=0 width=728 height=90 ></a> As you can see I tried to center it. I even typed right but still everything is aligned to the left. PLEASE, how do I center the banner and the weather widgets? Quick question. When using a generator to make a website, it seems that usually everything is placed into "DIV - ABSOLUTE" codes. How do I center everything up so it isn't all stuck to one side for users who have a higher resolution? Hey im new at this html programming and im ok at it but i still need to learn more i need help centering the stuff on my page you will see what i mean if you go to my website. firefoxskins.awardspace.com. I would really like help thank you for your time. Hey felllas. I really need some help here. I'm building this page, but can't get it to center. I bet it's somethign dumb I'm overlooking. could you please take a quick look at the source and LMK what I'm missing... http://bravoad.com/BravoTest2.html Thanks in advanced I am learning how to use Div's to replace Tables for layout. Needless to say, there are many properties I need to learn with CSS's. A friend wants a Floating area on the left which I have created, however I would like to have the box be centered in the main text area. Not sure if that can be done with my prototype at http://www.toddcary.com/viewpoint/div_todd_a.html Any help would be appreciated... Todd http://www.ivoog.com/test/help The boxes that have: Paypal, Policies, Financing, Wholesale, etc. How can these be centered in all browsers including IE6? I can't get it to work Here's the CSS: #othermain2 { width:850px; height:850px; float:left; } #middlestyle { width:850px; text-align:center; margin:auto; overflow:auto; } .middlebox { width:150px; text-align:center; float:left; font-size:24px; margin-left:50px; margin-top:50px; border:solid 5px #333; } .middlebox:hover { width:150px; text-align:center; float:left; font-size:24px; margin-left:50px; margin-top:50px; border:solid 5px #390; } FULL CSS: http://www.pics.ivoog.com/page/home.css Can anyone help me? Thanks. I Can't center my whole nav bar in the middle of the sidebar 1 div. Here is the link for the website. http://northwindappaloosas.com/NewHome.html <tr> <td class="contentarea_b"></td> </tr> <h3>=WFC= WAR FORCE CLAN AMERICAS ARMY</h3> <table cellpadding="0" cellspacing="0" border="0"><tr><td><object type="application/x-shockwave-flash" data="http://video.google.com/googleplayer.swf?docId=4279961105245592436&hl=en" height="350" width="425" style="width:400px; height:326px;" id="VideoPlayback"> <param name="movie" value="http://video.google.com/googleplayer.swf?docId=4279961105245592436&hl=en" /> <param name="allownetworking" value="internal" /> <param name="allowScriptAccess" value="ALWAYS" /> <param name="enableJSURL" value="TRUE" /> <param name="enableHREF" value="TRUE" /> <param name="saveEmbedTags" value="true" /> <param name="flashvars" value="" /> </object></td></tr><tr><td> </table> </td> How can I get a text or object to be displayed in the middle of the page vertically as well as horizontally? (Horizontally is sort of easy with align="center", but I cant figure it out, how to do it vertically). I can't get my whole nav bar to align to the center of my sidebar 1 div. Check it out please. http://northwindappaloosas.com I have a centered container div with a width of 850px. How do I put an image on the left/right of the div? or even make a bigger image than 850px and have it centered with the center 850px in the image to be black or white and the rest show outside the div, but not rollover or mess up when someone with a low resolution views the site if possible http://soundcoremusic.com/USED%20GEAR/usedgear.html I really need a webmaster to view my code and give me some options! I've done so much googling and had so many failed attempts to center this new page I'm working on but I just can't figure it out and its really holding me back Thanks! -Kurt edit: I feel like I've been placing the div container in the wrong place or something, i really need my code to be viewed and then some specific directions Ok, I searched the forum and cannot find a solution for my problem. If you could please help my by suggesting what to do or pointing me to a similar topic. I HAVE to use frames: helping dad with his website - he wants to keep his frames, he likes them. I have two of them - top and bottom one. The top one holds a banner and a short, horizontal menu (no scroll), the length of the bottom one wary depending on the content, so it's "scrollable". I do not know how to deal with FireFox pushing the bottom frame left after adding the scroll bar: At the same time IE keeps it nice and centered. The code for the index file is as follows: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> </head> <frameset rows="203,*" frameborder="no" border="0" framespacing="0" > <frame src="home1.htm" name="top" scrolling="No" noresize="noresize" title="top" target="middle" > <frame src="index2.htm" name="middle" title="middle" target="middle"> </frameset> <noframes> <body> Info on using frames </body> </noframes></html> To center the table I use for the bottom (called "middle") frame I use a <center> tag: Code: <body> <center> <table> <tr><td>Long long text...</td></tr> </table> </center> </body> I was reading somewhere that this is an outdated solution, but that's how I was able to deal with that. Any suggestions on how to center the bottom frame in FF? Hi there guys. I think for the most of you, an easy question: How do I center my whole webpage? (offcourse except for the background, because it is allready filling the whole screen.) This is my source: !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>V</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="author" content="fusiox" /> <meta name="description" content="forum" /> <meta name="keywords" content="v" /> <style type="text/css"> body { background-image: url(img/1168.png); background-repeat: repeat font-size: 12px; color:#ffffff; font-family: "Comic Sans MS", cursive; font-size: 12px; font-style: normal; font-weight: normal; font-variant: normal; } #inhoud { text-align: left; vertical-align: middle; margin: 20px auto; padding: 0px 0 0 0; width: 1024px; background-color: #000000; border: 2px solid #ffffff; position: absolute; font-family: "Comic Sans MS", cursive; font-size: 10px; font-weight: bold; color: #3C3; } img { padding: 0; margin: 0; font-family: "Comic Sans MS", cursive; font-size: 10px; color: #3C3; } p { padding: 0; margin: 0; } a { color: #ffffff; display: underline; } a:hover { color: green; } body,td,th { color: #000; font-family: "Comic Sans MS", cursive; font-size: 12px; font-weight: bold; } #apDiv1 { position:absolute; width:386px; height:427px; z-index:1; left: 32px; top: 197px; font-family: "Comic Sans MS", cursive; font-size: 10px; color: #3C3; font-weight: bold; } #apDiv2 { position:absolute; width:413px; height:405px; z-index:2; left: 555px; top: 334px; font-family: "Comic Sans MS", cursive; font-size: 12px; font-weight: bold; color: #3C3; } #apDiv3 { position:absolute; width:200px; height:115px; z-index:2; left: 72px; top: 412px; } </style> </head> </head> <body> sorry, I know, i am kind of a noob in the html world. Tnx, in advance! Hi I am new to html so I know this is probably a really simple matter however I am having trouble centering my swf file both horizontally and vertically. I have managed to center horizontally but cant seem to work out the vertical. Could anyone offer some help. My code is below <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <title></title> <script type="text/javascript" src="p2q_embed_object.js"> </script> <style type="text/css" title="Default"> body, div, h1, h2, h3, span, p { font-family: Verdana,Arial,Helvetica,sans-serif; color: #000000; } body { font-size: 10pt; background : #ffffff; } table,tr,td { font-size: 10pt; border-color : #777777; background : #dddddd; color: #000000; border-style : solid; border-width : 1px; } h1 { font-size: 18pt; } h2 { font-size: 14pt; } .warning { font-weight: bold; } </style> </head> <body> <div align="center"> <p><script type="text/javascript"> <!-- if ((window.p2q_Version) && (window.p2q_Version>=2.0)) { var flashvars=""; p2q_EmbedFlash('bar_out.swf','640','480','allowFullScreen','true','FlashVars',flashvars); // Check to see if the version meets the requirements for playback if (!DetectFlashVer(9,0,0)) { document.write('<p class="warning">This content requires Adobe Flash Player Version 9 or higher. ' + '<a href="http://www.adobe.com/go/getflash/">Get Flash<\/a><\/p>'); } } else { document.writeln('<p class="warning">p2q_embed_object.js is not included or it is too old! Please copy this file into your html directory.<\/p>'); } //--> </script> <noscript> <p class="warning">Please enable Javascript!</p></noscript></p> </div> </body> </html> Code: <p><center><table width="50%" bgcolor="black" cellpadding="20px"><tr><td><a href="index.html">Home</a></td><td><a href="imglist.html">Img list</a></td></tr><td><a href="about.html">About</a></td></tr></table></center></p> in ie the center works fine, but in firefox its almost 2 inches to the left of being center, why would that be? i want the ads on the center. not there. please anyone can help? screenshot: |