HTML - Help With Align And Valign
Dear users,
I have been having some trouble for quite sometime with both align and valign, I want to keep a iframe (Google Maps) absolutely centered regardless of the browser window size. This works fine for me until I want to add a picture on the page. When I add the picture I want it to be overlapping just slightly to the left of the iframe and stay like that regardless of window size also. I'm sure its just a basic container problem, but it also makes it harder when I'm using percentages. If anyone is having problems with what I'm trying to explain just ask and I'll try explain it a little bit better. http://www.autohotkey.net/~happytodd/index.html HTML Code: <style type="text/css"> #container{ position: relative; min-width:700px; min-height:100px; } #title { font-size: 65px; } #google { } #image { border: 1px; } </style> <body> <div id="container"> <div id="google"> <div id="image"> <table border="1" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td align="center" valign="middle"> <div id="title"><b>Where is Happytodd?</b></div> <br /> <img src="there_myselfEeek1.png" alt="Avatar"/> </div> <!-- Google Public Location Badge --> <iframe src="http://www.google.com/latitude/apps/badge/api?user=-7616294934996694352&type=iframe&maptype=roadmap" width="500" height="500" frameborder="0"></iframe> <!-- To disable location sharing, you *must* visit https://www.google.com/latitude/apps/badge and disable the Google Public Location badge. Removing this code snippet is not enough! --> </td></tr> </div> </div> </body> Similar TutorialsI'm having trouble getting valign to work on a table. Here is a screen shot of said table: http://www.novusinitium.co.uk/forum/ss.jpg And here is the code for that table: HTML Code: <table style="width:96%;margin:auto;"> <tr style="background-color:#000000;color:#FFFFFF;font-weight:bold;font-size:14pt;"><th colspan="2">Test Thread</th></tr> <tr style="background-color:#E0E0E0;font-weight:bold;"><td style="width:200px;text-align:center;">Conn</td><td style="padding-left:10px;">01.10.2008, 10:10<span style="margin-left:400px;"><a href="editPost.php?p=1"><img src="page_edit.png" alt="Edit Post" title="Edit Post" style="margin-left:10px;"></a><a href="deletePost.php?p=1"><img src="page_delete.png" alt="Delete Post" title="Delete Post" style="margin-left:10px;"></a></span></td></tr> <tr><td> <img src="http://www.fascinationst.com/productImages/CP1306D.jpg" style="width:150px;height:150px;margin-left:25px;margin-top:10px;" alt="Avatar"> <br> <p class="c">Administrative Duck</p> <div style="width:150px;margin-left:25px;background-color:#c0c0c0;padding:2px;font-size:8pt;"> <span>Posts: 2</span><br> <span>Group: <span style="color:#FF0000;">Admin</span></span><br> <span>Joined: 30.09.2008</span><br> <span>Country: England</span><br> <span>Game-Ranking: Newbie</span><br> </div> <br> <p style="text-align:center;"><a href="http://www.novusinitium.co.uk/messages.php?page=send&uid=1"><img src="email.png" alt="Message This User" title="Message This User"></a></p> </td><td valign="top" style="padding:10px;">This is a test post.</td></tr> <tr style="background-color:#E0E0E0;font-weight:bold;"><td style="width:200px;text-align:center;"></td><td style="text-align:right;padding-right:10px;padding-top:2px;"><a href="#top"><img src="arrow_up.png" alt="GoTo Top" title="GoTo Top" style="margin-left:10px;"></a><a href="reportPost.php?p=1"><img src="exclamation.png" alt="Report Post" title="Report Post" style="margin-left:10px;"></a></td></tr> <tr><td></td><td></td></tr> <tr style="background-color:#E0E0E0;font-weight:bold;"><td style="width:200px;text-align:center;">TEST</td><td style="padding-left:10px;">01.10.2008, 14:14</td></tr> <tr><td> <img src="http://imgs.xkcd.com/comics/turing_test.png" style="width:150px;height:150px;margin-left:25px;margin-top:10px;" alt="Avatar"> <br> <p class="c">TEST</p> <div style="width:150px;margin-left:25px;background-color:#c0c0c0;padding:2px;font-size:8pt;"> <span>Posts: 1</span><br> <span>Group: <span style="color:#000000;">Members</span></span><br> <span>Joined: 01.10.2008</span><br> <span>Country: England</span><br> <span>Game-Ranking: Newbie</span><br> </div> <br> <p style="text-align:center;"><a href="http://www.novusinitium.co.uk/messages.php?page=send&uid=2"><img src="email.png" alt="Message This User" title="Message This User"></a></p> </td><td valign="top" style="padding:10px;">A reply :O</td></tr> <tr style="background-color:#E0E0E0;font-weight:bold;"><td style="width:200px;text-align:center;"></td><td style="text-align:right;padding-right:10px;padding-top:2px;"><a href="#top"><img src="arrow_up.png" alt="GoTo Top" title="GoTo Top" style="margin-left:10px;"></a><a href="reportPost.php?p=3"><img src="exclamation.png" alt="Report Post" title="Report Post" style="margin-left:10px;"></a></td></tr> <tr><td></td><td></td></tr> </table> Any ideas why it's not working? Or what else i could do to get the same effect? Thanks. I have an asp page that loads select dropdowns sequentially. They are different sizes. I want them to align top regardless of the size. The problem is, if the second or third dropdown to load is bigger than an earlier one, then the td is stretched vertically and the earlier ones are not aligned top. You can view the page he http://www.h51software.net/usautomat...self_quote.asp Thanks for the help... I can't seems to be able to get it to a valign middle at oscommerce but on my html page it worked fine. Also why is the html page gray bar bigger than the oscomerce gray bar? Code: <table width="100%" height="30" align="center" border="0" bgcolor="grey"> <tr> <td class="bar1" valign="middle" height="100%"> <ul id="navlist"> <li id="active"><a href="/index.html" id="current">Home</a></li> <li><a href="index.php">Collections</a></li> <li><a href="/payment.html">Payment & Shipping</a></li> <li><a href="/about.html">About us</a></li> <li><a href="contact_us.php">Contact Us</a></li> </ul> </td> </tr> </table> Code: .bar1 {font-family:Arial, Helvetica, sans-serif; font-size: 14px; text-align:center;} #navlist ul {margin-left: 0;padding-left: 0;white-space: nowrap;} #navlist li {display: inline;list-style-type: none;} #navlist a { padding: 15px 20px; } #navlist a:link, #navlist a:visited {color: #fff;background-color: grey;text-decoration: none;} #navlist a:hover{color: #fff;background-color: #6D6968;text-decoration: none;} actual site http://janlevin.com.my/ I am havin an issue with some code ... I'm tryin to valign it to middle but it isnt accepting ANY code i try besides what code is already being used. heres a snippet of the table.... Code: <table cellspacing="1" cellpadding="1" border="0" style="width: 550px;"> <thead> </thead> <tfoot></tfoot> <tbody> <tr> <td height="30" bgcolor="#cccc99" valign="middle"><strong>Date</strong></td> <td height="30" bgcolor="#cccc99" valign="middle"><strong>Sermon Title</strong></td> <td height="30" bgcolor="#cccc99" valign="middle"><strong>Notes</strong></td> <td height="30" bgcolor="#cccc99" valign="middle"><strong>Podcast</strong></td> </tr> Thanks! Im trying to valign some text, but when there is an image in the same field it doesn't work. Heres an example: PHP Code: <html> <body> <table border=1><tr><td valign="middle"> test text <img src="http://fiestafan.com/120.png"> </td></tr></table> </body> </html> Anyone know how to do this? I am trying to keep everything in line, but valign is not working I do not believe? <td width="60%" align="left" valign="middle">$selection <input type="button" value="Create New" onclick="window.location.href='$scripturl';"></td> The button is the same height as the drop down selection list created in the string $selection, but the drop down list is higher than my button? I have a table cell to the left which has a <br /> in it, not sure if this matters? Hi there. So, I've got this page I'm working on, see... http://www.giardinidisole.com/splash/splash.html ...and if you see the text in the space next to the pics, I'm trying to get them to align at the top of the cell. I've tried putting the <valign="top"> tag in the <tr> and I've also tried putting it in each <td> but as you can see the text lines up in the middle. Am I missing something? Gidmeister i have a javascript running a scrolling text on my site and im trying to position it to either align to the right or set x,y coordinates... i already tried putting align =right in the tag and it didnt work here is what im working with... http://www.freewebs.com/fallingrain11/1.html here is the call up im using i also <iframe width="165" height="215" src="irawr-scrollernewstic.html" SCROLLING="no" FRAMEBORDER="0" border=0></iframe> I'm learning HTML and the teacher has us learning deprecated tags - Just to let you. If I want to center this tag, where do I put the align code? <h1><font color="#4f4fc1">HTML Forums</font></h1> HELP! I'm trying to make this page/table align to the top of the page so that when the entire page is maximized, it will still "stick" to the top rather than in the middle of the page. The editor I am using (Visual Studio 2003) shows that it is at the top of the page but when running it and maximized the page, the content is centered to the middle of the page. Any ideas on how to resolve this? It is using a bit of CSS too..... Code: <body bottomMargin="0" rightMargin="0" MS_POSITIONING="GridLayout"> <form class="crm" id="crmForm" method="post" runat="server"> <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td> <table height="100%" cellSpacing="0" cellPadding="0" width="100%"> <TBODY> <tr> <td> <div class="simon"> <table style="TABLE-LAYOUT: fixed" cellSpacing="0" cellPadding="0" width="100%" border="0"> <COLGROUP> <col width="110"> <col> <col> <col width="120"> <TBODY> <tr> </tr> <tr> <td style="FONT-WEIGHT: bold; BORDER-BOTTOM: black 1px solid" height="24"> </td> <td style="FONT-WEIGHT: bold; BORDER-BOTTOM: black 1px solid" height="24">Candidate Details</td> <td style="FONT-WEIGHT: bold; WIDTH: 299px; BORDER-BOTTOM: black 1px solid" height="24">Vacancy Details</td> <td style="FONT-WEIGHT: bold; BORDER-BOTTOM: black 1px solid" height="24">Filtering Options</td> </tr> <!--etc..... --> css: Code: formButton { background-color: #6699cc; padding: 2px 4px 3px 4px; color: #000000; font-size: 8pt; font-family: tahoma; height: 17px; filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#B4C5DF, EndColorStr=#91A9D0); border-width: 0px; } TEXTAREA { font-size: 8pt; font-family: tahoma; width: 100%; height: 100%; border: 1px solid #7b9ebd; } .inputfields { font-size: 8pt; font-family: tahoma; width: 100%; height: 19px; border: 1px solid #7b9ebd; } INPUT.rad { width: 15px; border: 0px; cursor: hand; } DIV.tab { overflow-y: auto; padding: 10px; } TD.sec { width: 100%; color: #000000; font-weight: bold; padding-left: 0px; padding-bottom: 2px; text-overflow: ellipsis; overflow: hidden; } TD { font-size: 11pt; font-family: tahoma; } TD.bar { border-bottom: 1px solid #000000; } TD.req { font-weight: bold; color: #9F2409; overflow: hidden; text-overflow: ellipsis; padding-top: 5px; } TD.statusBar { background-color: #63769B; color: #ffffff; padding-left: 5px; height: 24px; border-bottom: 1px solid #485673; font-weight: bold; } LABEL { cursor: hand; } TD.radioLabel { padding-left: 2px; padding-right: 10px; } TABLE.layout { table-layout: fixed; width: 100%; height: 100%; } div.tab { width: 100%; height: 100%; border: 1px solid #466094; background-color: #EEF0F6; display: none; } body { font-size: 11px; margin: 0px; border: 0px; background-color: #EEF0F6; cursor: default; } td { font-size: 11px; } table { cursor: default; } a { color: #0000ff; font-weight: bold; } span.menu { height: 100%; padding: 2px; padding-left: 5px; padding-right: 5px; border: 1px solid #7288AC; } table.mnuBar { color: #000000; height: 22px; width: 100%; filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#DCDFE5, EndColorStr=#BDC2CB); } td.mnuTitle { font-size: 11px; font-weight: bold; letter-spacing: 1px; cursor: default; color: #000000; } td.mnuRight { width: 100%; text-align: right; padding-right: 5px; } DIV.header { font-size: 20px; font-weight: bold; color: #000099; margin-bottom: 20px; border-bottom: 1px solid #000044; } TR.header { font-weight: bold; background-color: #E0E3E8; } th { border-right:0; border-left:0; background:url(imgs/bar_line.gif) left center no-repeat; } dataGrid.Table { border-collapse: collapse; border-spacing: 0; background-color: #000000; } dataGrid.td, th { margin:0; padding:0; } .Glass { background-image:url(Img/Blank.gif); background-repeat:repeat-x; } .Glass:hover { background-image:url(Img/GradientBlue.gif); background-repeat:repeat-x; } Hi, Can anyone tell me how i can accomplish this: http://www.tendervendors.com/dev/index-table.html without using display: table-cell. Atm, the exact same code, just without display: table-cell displays: http://www.tendervendors.com/dev/index.html Anyone got any ideas? TIA Matthew Millar <td valign="top" background="" rowspan="9" width="666"><div style="width: 200; height: 200; background-color: transparent; font-family: arial; font-size: 11px; color: FF2222; font-weight: normal; font-style: normal; text-align: left; border-width: 1px; border-style: solid; border-color: 952716; overflow: auto; padding: 5px;">Test</div> This is the code i have. How would i move it away from the top and left side by a certain amount of pixles? For example, 100 pixles from top and 50 from left side. Hi every one. Well i have a problem with align="center" In tow PCs this align not working (its not coming to center) In one PC that i tried somehow its work. I did the same in all 3 PCs. So my question is why ??? Thanks I have three DIV: <!-- Top 5 Hotels --> <div id="top5container"> HOTELS/RESORTS<br /> </div> <!-- Top 5 Restaurants --> <div id="top5container"> RESTAURANTS </div> <!-- Top 5 Shows --> <div id="top5container"> ENTERTAINMENT </div> I want to wrap those three DIVs (most likely in another DIV) and have them centered in this DIV. See www.vegastraveling.com and see on the welcome page. I want the 3 "top 5" to be centered... but I can't seem to have it work So it's basically centering 3 DIVs within a DIV. Hi, I wonder if anyone could help me solve what is probably a very simple problem. My website is www.danmondayeteaching.com In Chrome and Safari it displays how I want it. However, in IE my e-mail address will not align right. In Firefox there is a thin black border to the cell with my e-mail address in. I've tried lots of ways to solve the problem to no avail. Here is the offending code: <tr> <td nowrap width="80%" border= "0" style="border-style: none; border-width: medium" height="102"> <p style="margin-left: 6; margin-top: 0; margin-bottom: 0"><b><font color="#FFFFFF" size="6" face="Verdana">Dan Monday E-teaching</font></b> </p> <p style="margin-left: 6; margin-top: 0; margin-bottom: 0; horizontal-align: middle"><b><i><font color="#A8E1F2" face="Verdana"> <img src="skypelogo.png" alt="Skype" img style="vertical-align:middle"> your way to better English</font></i></b> </td> <td width= "20%" border= "0" style="border-style: none; border-width: medium" height="102"><td align= "right"> <p style= "text-align: right; margin-right: 28;"><b><font color="#FFFFFF" size="4" face="Verdana">monday.daniel@gmail.com</font></b></p></td> </tr> tldr - IE won't align my e-mail address to the right. Thanks in advance for any suggestions. why can't i align my texarea and my three side panels? http://www.hottunaint.com/press7test.html i have this 2 images firefox ie7 how can i make the page in in intenret excplorer to look like in firefox? here is the code PHP Code: <?php include("muzica/config.inc"); $link = mysql_connect($mysql_host, $mysql_username, $mysql_password); $result = mysql_query("SELECT id, name, artist, catagory, size FROM ".$mysql_database.".songs ORDER BY id DESC LIMIT 5;"); for($i = 0; $i < mysql_num_rows($result); $i++) { echo "<br style=\"line-height:3px\">"; echo "<table width=\"100%\"><tr><td width=\"80%\"><img src=\"images/marcer.gif\" align=\"left\" style=\"margin-left:6px; margin-right:6px\"><span class=\"orange\"><a href=\"muzica/browse.php?catagory=".mysql_result($result, $i, "catagory")."\" class=\"orange\">".mysql_result($result, $i, "artist")." - ".mysql_result($result, $i, "name")."</a></td> <td>".mysql_result($result, $i, "size")."</td> </tr></table></span>"; echo " <br style=\"line-height:9px\">"; echo "<img src=\"images/hl2.gif\"><br>"; } mysql_free_result($result); mysql_close($link); ?> So first off I would like to say I am new to website design & html. I have really just messed around with free templates in an attempt to make a decent website. Please feel free to talk to me like a child. My main problem is with images on my site not aligning. I have looked over the code so many times and do not understand why they are out of wack! Here is the url http://www.springfieldsqueencityroll...y.com/T&S.html I would apreciate any feedback you could give me. Thanks in advance! Anne-Marie Also I don't know if the code is needed on this post but if a code is needed just let me know I will be happy to provide it. Hello I have images on my site found here. You can see them on the top news bar, RSS feed, Facebook, Twitter How can I make those same line, aligned to the right. Here is the current code for this section. HTML Code: <div id="contenttitle">RuneHints, Clan & RuneScape News <a href="http://feeds.feedburner.com/RunehintsNews"><img src='http://runehints.com/forums/public/style_images/master/feed.png' alt='RSS Feed' id='rss_feed' class='clickable' /></a><a href="http://www.twitter.com/runehints"><img src="http://twitter-badges.s3.amazonaws.com/t_mini-a.png" alt="Follow runehints on Twitter"/></a><a href="http://feeds.feedburner.com/RunehintsNews"><img src="http://runehints.com/images/f_logo.png" alt="Follow RuneHints on Facebook" width="16" height="16" /></a></div> |