HTML - Centering Page But Text Aligned Left.
Hi.
I can't figure out how to have all the tables on my site aligned to the centre yet have the text in them aligned to the left. In other words I want 2 margins either side of the central body of my site. How can I do this? Thanks. Similar TutorialsPlease help anyone... even though they appear normally aligned and centered from inside DW all my table are aligned left when previewed in a Firefox. It's all good in IE. Have spent half of a day trying to figure it out <table width="527" height="2180" border="1" align="center"> <tr> <td><span class="style23">xxxxx</span></td> </tr> </table> I doubt that this means much but here is one of the tables. If it means something, this started to happen when I had to put a whole book online for one of my customers that had problems downloading it. So, in the process I copy/pasted from Word to DW. I had to do it. I know that these kind of things can sc... everything up so I made sure that I first cleared all the formatting from Word. So, I'm in a pickle now... Greetings from Norway! This is my first post on this forum! I am currently developing my website, and when I checked the page in Firefox, Safari and Chrome it seemed perfectly fine, but when loading it in IE and Opera it looked strange. the page: http://aksjefinans.com/bilde.html In Opera and IE the text in the tables are centered while in the other browsers it is aligned to the left (this is how it should look). Why is the table text centered in IE and Opera? I have looked over my code several times and tried a lot of different moves, but it always ends up like this in IE and Opera. Centered text does not look any good. What should I do to make the page look the same in IE as in firefox? Hope someone could help me! How can I make the text appear at left bottom... I have 3 taGS RETURNING DATA FROM sql: <p> #TOC# </p> <p> BUSINESS POLICY TRADEMARK REGULATIONS. </p> <p> #Qry.USERSIGN# </p> I want the text from this tag to appear one after other at left bottom: For example: This is basic algebra lesson. BUSINESS POLICY TRADEMARK REGULATIONS. Smith How to do that? Any advise is appreciated.RosieGp What would be the best way to center the items listed in the left column? Thank you. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0.11 Transitional//EN"> <html><head> <title>test</title> <script src="java.js" type="text/javascript"></script> <link rel="STYLESHEET" type="text/css" href="styles.css"> <style type="text/css"> .test{background-color:#ffdead;} #header { width: 830px; margin-left: auto; margin-right: auto; margin-top: -15px; background-color: #ffdead; } #header_table { width: 75%; border-collapse: collapse; border: solid 1px; border-color: #b7b7b7; } .header_bar { padding: 0px; margin: 0px; border-bottom-style: solid; border-bottom-width: 10px; border-bottom-color: #b7b7b7; background-color: #800000; width: 150px; border-collapse: collapse; border-right-width: 0px; border-left-width: 0px; } .header_body { padding: 0px; margin: 0px; border-left-style: solid; border-left-width: 1px; border-left-color: #b7b7b7; border-right-style: solid; border-right-width: 1px; border-right-color: #b7b7b7; } </style> </head> <body bgcolor="#ffffff"> <table id="header_table" align='center' cellpadding='0' cellspacing='0'> <tr> <td class="header_bar" colspan='2'> </td> </tr> <tr> <td align='center' colspan='2'> <img src="imgi/img11.jpg" height="134" width="461"> <img src="imgi/topimg2.jpg" height="160" width="309"> </td> </tr> <tr> <td class='header_body' valign='top' width="200"> <form action="login.asp" method="post"> <table width="100%" height="100%" align='center' cellpadding="0" cellspacing="0" border="0" > <tr><td valign="top" class='header_bar' colspan='2'> </td></tr> <tr> <!-- SIDE MENU --> <% If Session("PMMS_IN") = "True" Then '// CHECK IF MEMBER IS LOGGED IN ALREADY %> <!-- MENU FOR LOGGED MEMBER ONLY --> <td colspan="2"><br><br>Welcome <i><%'=Session("PMMS_NAME")%></i><br /><br /></td> </tr><tr> <td width="15">º</td> <td><a class="lnk" href="profile.asp">My Profile</a></td> </tr><tr> <td width="15">º</td> <td><a class="lnk" href="_purchase.asp">Purchase</a></td> </tr><tr> <td width="15">º</td> <td><a class="lnk" href="newsletter.asp">Newsletters</a></td> </tr><tr> <td width="15">º</td> <td><a class="lnk" href="members.asp">Member List</a></td> </tr><tr> <td width="15">º</td> <td><a class="lnk" href="members_by_group.asp">Group Member List</a></td> </tr><tr> <td width="15">º</td> <td><a class="lnk" href="file_cate.asp">File Repository</a></td> </tr><tr> <td width="15">º</td> <td><a href="login.asp?logout=True">Log Out</a></td> </tr> <!-- [ MENU FOR LOGGED MEMBER ONLY ] --> <% Else ' IF NOT LOGGED IN THEN SHOW THE LOGIN FORM%> <!-- INCLUDE LOGIN FORM --> <br><br><td colspan='2'><br><br>Username:<center><br /><input class="textbox" type="Text" name="username" value="<%=Trim(Request.Cookies("USERNAME"))%>" maxlength="25" size="20" /></td> </tr><tr> <td colspan='2'><br>Password:<center><br /><input class="textbox" type="Password" name="password" value="" maxlength="25" size="20" /></td> </tr><tr> <td> <br><input type="Checkbox" name="rem" value="1"<%If NOT Trim(Request.Cookies("USERNAME")) = "" Then%> checked<%End If%> />Save Username<br /> <input style="width: 50%;" type="Submit" value="Login Now" /><br /><br /><a href="reminder.asp">Password Reminder</a> </td> </tr> <tr> <td> <br /> <input type="Hidden" name="mode" value="login" /><input type="Hidden" name="ref_page" value="<% If Len(Trim(Request.QueryString("ref_page"))) = 0 Then%><%=Request.ServerVariables("URL") & "?" & Request.QueryString%><%Else%><%=Request.QueryString("ref_page")%><%End If%>" /> <!-- [ INCLUDE LOGIN FORM ] --> <% End If %> </td> </tr> <tr> <td> <br /><br /> <img src="img/linkimg1.gif" width="25" height="24" alt="" border="0" /><a class="MainMenuLNKExample" href="index.asp"> HOME</a><br /><br> <img src="img/linkimg3.gif" width="25" height="24" alt="" border="0" /><a class="MainMenuLNKExample" href="register.asp"> FAQ</a><br /><br> <% If Session("PMMS_IN") = "True" Then '// CHECK IF MEMBER IS LOGGED IN ALREADY %> <img src="img/_example/arrow_gray_top_inverse_b.gif" width="15" height="14" alt="" border="0" /><a class="MainMenuLNKExample" href="login.asp?logout=True">LOG OUT</a> <% Else %> <img src="img/linkimg2.gif" width="25" height="24" alt="" border="0" /><a class="MainMenuLNKExample" href="register.asp"> REGISTER</a><br /><br> <% End If %> <img src="img/linkimg4.gif" width="25" height="24" alt="" border="0" /><a class="MainMenuLNKExample" href="register.asp"> TERMS OF USE</a><br /><br> <img src="img/linkimg5.gif" width="25" height="24" alt="" border="0" /><a class="MainMenuLNKExample" href="register.asp"> CONTACT US</a><br /><br /> </a> <!-- [ SIDE MENU ] --> <br /><br /> </td> </tr> </table> </form> </td> <td class='header_body'> <!-- MAIN PAGE CONTENT --> Hi.. is there any possibility to do something like on that screen pictu http://www.speedyshare.com/387574283.html i mean a page layout with two frames, both aligned to the center of the page ? plz help :/ thx in advance Hello, I've put the Code: <div align="center"> below the Code: <body> tag and closed it with the Code: </div> before the Code: </body> tag. The page doesn't center at all. Is looking fine in 1024x768 but in any bigger resolution, the page is aligned to the left. The page that I am talking for is this. Any idea? Hello. I have text at the top right, "A Site for All Nations to Share their Knowledge!" and I need to move it to the left a bit so its not overlapping the sun image. I appreciate You! Hello chaps, I have a .php page and for some unknown reason the text will not centre itself in each of the cells. It's centred in the horizontal aspect, but vertically it always starts at the top. I thought that one only had to use the align="centre" tag when declaring the table. Interestingly if I convert the .php to .htm then the text does centre itself. What am I missing! Cheers etala Im trying to center and justifty text on my website and really stuggling with it. Any help is appreicated!! Thanks Dave I have a mobile application and the text is top aligned in the Blue division rather than centered: <div class="header"> <span style="">TREO 600 LITIGATION</span> </div> Not sure what to put in the Span tag. .header { height: 2.0em; background-color: blue; text-align: center; color: white; font-weight: bold; } And I am viewing this as a Mobile application on an iPhone. Todd For some strange reason if I want to have an ad or image on the left of my text article usually i put a div code around whatever it is like.. Code: <div style="DISPLAY: block; FLOAT: left; MARGIN: 0px 10px 0px 0px"> </div> This works GREAT in firefox but then i was shocked when i went over to Internet explorer and tested my site there using the latest browser.. it doesnt acknowledge that code and so the ad or the image ends up being above my article instead of nicely on the left and the text wrapped around it on the right like you see in firefox Any ideas how to get around this? Maybe a fix that works for ie. and firefox? thank you guys and gals in advance I am trying to create a page header that has an image on the left and text that should be centered, however the centering takes into consideration the image. I would like the centering to use the full width. Can this be done? http://www.toddcary.com/pvrc/test1/header.html I don't know if this should really go in the css forum or here, but here it is. The page in question is at the following link: http://www.sikaband.com/archives/new/index.html and the css file being referenced is: http://www.sikaband.com/archives/new/blackstyle.css Viewing the page in Firefox, the links in the navigation bar are centered the way they ought to be. Safari for some reason shunts the text off to the right a good ways. When I put a visible border on the div in question, I can see that the div itself is aligned properly, it's just the text inside that's off. I'm confused. Hello all- This is my first post on HTML forums, and I hope ya'll can help me out with this issue. I feel really dumb...and think that my problem is probably a simple one, but I can't figure it out. I've got a left sidebar, coded to float left in CSS, and in dreamweaver it shows up appropriately. However, whenever I look on firefox or ie, the left shows up on the right. I've also got an orange background image that DOES show up in the correct spot. I'm wondering if my problem could be related to the fact I've got the image listed under main-content, not the left sidebar. I've moved that line in the CSS, but it didn't help. Here is a link to my problem: http://www.durhamsafekids.org/main.html Here is my CSS code: Code: body { font-size: 62.5%; background: url(images/top-bdr.jpg) repeat; } p, li { font: 1.2em/1.8em Sabon, sans-serif; margin-bottom: 10px; } h1 { font: 2.0em "Helvetica Neue", sans-serif; color: white; height: 0px; } h2 { font: 1.8em "Helvetica Neue", sans-serif; color: #99cc33; margin-bottom: 10px; } h4 { font :Georgia, "Times New Roman", Times, serif; color: #0078AA; } h3 { font :Georgia, "Times New Roman", Times, serif; color: #333399; } ul { margin-left: 25px; } img { border: none; } #page-wrap { background: white; width: 960px; margin: 10px auto; } #page-wrap #inside { margin: 10px 10px 0px 10px; padding-top: 10px; padding-bottom: 10px; } #main-content { background: url(/images/left-sidebar.gif) repeat-y white; padding-left: 230px; padding-top: 20px; } #header { background: #ffffff; text-align: center; } #menu { background: #ffffff; } #left-sidebar { width: 185px; float: left; padding-left: 15px; padding-top: 20px; } #footer { background: #99cc33; text-align: center; padding-top: 20px; padding-bottom: 20px; color: #006699; font-size: 12px; } .footer a:link { /* Applies to unvisited links in class mainNav */ text-decoration: none; font-weight: bold; color: #006699; } .footer a:visited { /* Applies to visited links in class mainNav */ text-decoration: none; font-weight: bold; color: #006699; } .footer a:hover { /* Applies to links under the pointer in class mainNav */ text-decoration: underline; font-weight: bold; color: #006699; } /* ================================================================ This copyright notice must be kept untouched in the stylesheet at all times. The original version of this stylesheet and the associated (x)html is available at http://www.stunicholls.com/menu/pro_drop_2.html Copyright (c) 2005-2007 Stu Nicholls. All rights reserved. This stylesheet and the associated (x)html may be modified in any way to fit your requirements. =================================================================== */ .preload1 {background: url(menu/three_1.gif);} .preload2 {background: url(menu/three_1a.gif);} #nav {padding-left:217px; margin:0; list-style:none; height:38px; background:#fff url(menu/three_0.gif) repeat-x; position:relative; z-index:500; font-family:arial, verdana, sans-serif;} #nav li.top {display:block; float:left; height:38px;} #nav li a.top_link {display:block; float:left; height:35px; line-height:33px; color:#ccc; text-decoration:none; font-size:11px; font-weight:bold; padding:0 0 0 12px; cursor:pointer;background: url(menu/three_0.gif);} #nav li a.top_link span {float:left; display:block; padding:0 24px 0 12px; height:35px; background: url(menu/three_0.gif) right top no-repeat;} #nav li a.top_link span.down {float:left; display:block; padding:0 24px 0 12px; height:35px; background: url(menu/three_0a.gif) no-repeat right top;} #nav li:hover a.top_link {color:#fff; background: url(menu/three_1.gif) no-repeat;} #nav li:hover a.top_link span {background:url(menu/three_1.gif) no-repeat right top;} #nav li:hover a.top_link span.down {background:url(menu/three_1a.gif) no-repeat right top;} /* Default list styling */ #nav li:hover {position:relative; z-index:200;} #nav li:hover ul.sub {left:1px; top:38px; background: #bbd37e; padding:3px; border:1px solid #5c731e; white-space:nowrap; width:110px; height:auto; z-index:300;} #nav li:hover ul.sub li {display:block; height:20px; position:relative; float:left; width:110px; font-weight:normal;} #nav li:hover ul.sub li a {display:block; font-size:11px; height:18px; width:108px; line-height:18px; text-indent:5px; color:#000; text-decoration:none;border:1px solid #bbd37e;} #nav li ul.sub li a.fly {background:#bbd37e url(menu/arrow.gif) 100px 6px no-repeat;} #nav li:hover ul.sub li a:hover {background:#6a812c; color:#fff; border-color:#fff;} #nav li:hover ul.sub li a.fly:hover {background:#6a812c url(menu/arrow_over.gif) 100px 6px no-repeat; color:#fff;} #nav li:hover li:hover ul, #nav li:hover li:hover li:hover ul, #nav li:hover li:hover li:hover li:hover ul, #nav li:hover li:hover li:hover li:hover li:hover ul {left:110px; top:-4px; background: #bbd37e; padding:3px; border:1px solid #5c731e; white-space:nowrap; width:110px; z-index:400; height:auto;} #nav ul, #nav li:hover ul ul, #nav li:hover li:hover ul ul, #nav li:hover li:hover li:hover ul ul, #nav li:hover li:hover li:hover li:hover ul ul {position:absolute; left:-9999px; top:-9999px; width:0; height:0; margin:0; padding:0; list-style:none;} #nav li:hover li:hover a.fly, #nav li:hover li:hover li:hover a.fly, #nav li:hover li:hover li:hover li:hover a.fly, #nav li:hover li:hover li:hover li:hover li:hover a.fly {background:#6a812c url(menu/arrow_over.gif) 110px 6px no-repeat; color:#fff; border-color:#fff;} #nav li:hover li:hover li a.fly, #nav li:hover li:hover li:hover li a.fly, #nav li:hover li:hover li:hover li:hover li a.fly {background:#bbd37e url(menu/arrow.gif) 110px 6px no-repeat; color:#000; border-color:#bbd37e;} And here is my HTML code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html" /> <title>Durham County Safe Kids</title> <link rel="stylesheet" type="text/css" href="style.css" /> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style-ie.css" /> <![endif]--> </head> <body> <div id="page-wrap"> <div id="inside"> <div id="header"><!-- #BeginLibraryItem "/library/header.lbi" --><img src="images/Header2.jpg" alt="Durham County Safe Kids" name="headerimage" width="775" height="200" border="1" style="background-color: #CCCCCC"> <!-- #EndLibraryItem --></div> <div id="menu"><!-- #BeginLibraryItem "/library/menu.lbi" --> <span class="preload1"></span> <span class="preload2"></span> <ul id="nav"> <li class="top"><a href="library/index.html" class="top_link"><span>Home</span></a></li> <li class="top"><a href="#nogo2" id="safety" class="top_link"><span class="down">Safety</span></a> <ul class="sub"> <li><a href="#nogo3" class="fly">Vehicle Safety</a><ul> <li><a href="#nogo4">Car Seats</a></li> <li><a href="#nogo5">Spot the Tot</a></li> <li><a href="#nogo6">Hyperthermia</a></li> <li><a href="#nogo7">Distracted Driving</a></li> </ul> </li> <li><a href="#nogo8">Poison Prevention</a></li> <li><a href="#nogo9">Wheeled Safety</a></li> <li><a href="#nogo10">Firearms Safety</a></li> <li><a href="#nogo11">Water Safety</a></li> <li><a href="#nogo12">Home Safety</a></li> <li><a href="#nogo13">Pedestrian Safety</a></li> </ul> </li> <li class="top"><a href="#nogo54" id="events" class="top_link"><span>Events</span></a></li> <li class="top"><a href="#nogo55" id="links" class="top_link"><span>Links</span></a></li> <li class="top"><a href="#nogo56" id="photos" class="top_link"><span>Photos</span></a></li> <li class="top"><a href="#nogo57" id="about" class="top_link"><span>About Us</span></a></li> </ul> <!-- #EndLibraryItem --></div> <div id="left-sidebar">This Text should be in the Orange Left Sidebar.</div> <div id="main-content"><img src="images/preventingunintentionalinjury.gif" alt="" width="529" height="127" align="right" /><br /><br /> <h2>This website is currently under construction. Please come back soon!</h2> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> </div> <div style="clear: both;"></div><!-- #BeginLibraryItem "/Library/footer.lbi" --> <div id="footer"> <table align="center" width="50%" border="0" cellspacing="1" cellpadding="1"> <tr> <th scope="col"><span class="footer"><a href="index.html">Home</a></span></th> <th scope="col"><span class="footer"><a href="#">Safety</a></span></th> <th scope="col"><span class="footer"><a href="#">Messages</a></span></th> <th scope="col"><span class="footer"><a href="#">Links</a></span></th> <th scope="col"><span class="footer"><a href="#">Photos</a></span></th> <th scope="col"><span class="footer"><a href="#">About Us</a></span></th> </tr> </table> <br> <center><font size="+2" color="FFFFFF"><strong>Durham County Safe Kids</strong></font></center> </div><!-- #EndLibraryItem --></div> <div style="clear: both;"></div> </div> </body> </html> As you can see from the linked screenshot, the text shows up on the right side of the page, not in the orange box. http://www.durhamsafekids.org/dskscreen.jpg Thanks all! ~Jeff I have a web page that I had to convert from a .psd file to an html and I'm not able to center a submit button and the text field next to it. I've tried various alignments but I'm also limited by what I can do because when you convert from .psd to html the entire page is one form. I don't have an external link but I'm able to provide html if necessary. Can someone please take a look at my code and offer some suggestions? Thank you Doug I just noticed that the site I coded is not centered but is aligned to the left on resolutions larger than 1024x768. Is there a way to fix this? Here is the css for the main div which has all the content. #container { position:absolute; left:0px; top:0px; width:1002px; height:auto; margin:0px auto; border:0; padding:0; I know some HTML but not a lot. I'm working on an HTML version of my companies website (it's currently in flash.) I'm happy with the design right now but I can'ty seem to find a way to center all of the contents of the page. Any help would be very much appreciated. http://www.ars-guardian.com/htmlhome.html Ive had this problem where when i create a page and I view it on my computer, it looks fine and centered. But when i access my site from another computer with a different sized monitor, it looks a lot different and uncentered. How do I get my page to look the same on every computer no matter the size? Thank You. |