CSS - Text Alignment Issues
Greetings all---
I've been playing more and more with css and div layouts and have run into an issue. Not the typical carriage-return issue but something a little more peskier. My website is quite simply laid out as: div - logo top div - navigation div - logo bottom div - content span - header1 span - header div - content footer Code: <html> <body> <div id="wrapper"> <!--navtop--> <div id="navtop"> </div> <div> <span class="links"> <img src="images/borderleft.png" /><a href="http://www.coastalequip.com"><img src="images/coastalequip.png" /></a><img src="images/logomid.png"/><a href="http://www.pickyourlandscaper.com"><img src="images/pickyourlandscaper.png" /><img src="images/borderright.png" /></a></span> </div> <div> <img src="images/logobottom.png" /> </div> <!--content--> <div id="content"> <!--content header--> <span class="header1"> BAR </span> <br /> <span class="header2"> FOO </span><br /> <br /> <!--content body--> <span class="body_text"> Lorem Ipsum </span> </div> <!--content bottom--> <div id="contentbottom"> </div> </div> </body> </html> I've decided to style every attribute using CSS to give myself some freehand practice. I decided to keep my project more organized by adding a wrapper around my project so that I would only have to use the width attribute once in my css. Well- after I added the div wrapper around my project and aligned it to center I ran into my issue. I can't seem to align the text in the class header1 to center. Padding will move it, but it seems fixed to the left; header2 centers fine. I've made sure all of my html tags were closed and I haven't seen any issues in my coding but I think some extra sets of eyes will help. CSS: Code: /* CSS Document */ body { background-color:#CCC; } img { border:0; padding:0; } #wrapper { width: 794px ; margin-left:auto; margin-right:auto; } #navtop { background-image:url(../images/logotop.png); height:129px; } #content { background-image:url(../images/bodybg.png); background-repeat:repeat-y; background-position:center; font-family:Tahoma, Geneva, sans-serif; } #contentbottom { background-image:url(../images/contentbottom.png); background-repeat:repeat-y; background-position:center; height:28px; } .header1 { text-align:center; padding:10px; font-family:Tahoma, Geneva, sans-serif; font-size:50px; font-weight:bolder; text-shadow:#666; text-transform:uppercase; color:rgb(190,30,45); } .header2 { text-align:center; padding:10px; font-family:Tahoma, Geneva, sans-serif; font-size:35px; font-weight:bolder; text-shadow:#666; text-transform:uppercase; color:rgb(0,0,0); line-height:.5em; } .body_text { text-align:left; padding:10px; } Similar TutorialsHi all this is my first post on the board! I have a slightly annoying problem with a nav menu I am trying to make; Here is the css #nav { background:url(images/nav.gif) no-repeat; width:470px; height:40px; margin-top:44px; padding:0; } #nav span { display: none; } #nav li, #nav a { height:40px; display:block; } #nav li { float:left; list-style:none; display:inline; } #nav-01 {width:65px;} #nav-02 {width: 65px;} #nav-03 {width: 65px;} #nav-04 {width: 65px;} #nav-05 {width:65px;} #nav-06 {width: 65px;} #nav-07 {width: 65px;} #nav-01 a:hover{background:url(images/nav.gif)0px -45px no-repeat;} #nav-02 a:hover {background:url(images/nav.gif) -65px -45px no-repeat; } #nav-03 a:hover {background:url(images/nav.gif) -130px -45px no-repeat; } #nav-04 a:hover {background:url(images/nav.gif) -195px -45px no-repeat; } #nav-05 a:hover {background:url(images/nav.gif) -260px -45px no-repeat; } #nav-06 a:hover {background:url(images/nav.gif) -325px -45px no-repeat; } #nav-07 a:hover {background:url(images/nav.gif) -390px -45px no-repeat; } Here is the HTML: <ul id="nav"> <li id="nav-01"><a href="index.html"><span>HOME</span></a></li> <li id="nav-02"><a href="index.html"><span>PLANNING</span></a></li> <li id="nav-03"><a href="index.html"><span>STRATEGY</span></a></li> <li id="nav-04"><a href="index.html"><span>DELIVERY</span></a></li> <li id="nav-05"><a href="index.html"><span>NEWS</span></a></li> <li id="nav-06"><a href="about.html"><span>ABOUT US</span></a></li> <li id="nav-07"><a href="index.html"><span>CONTACT</span></a></li> </ul> The problem I am having is that although the images are aligned when you hover over them, the image is sliced at the wrong position, I have tried adjusting every part of the css I can think of but I still can't figure it? Any ideas or help would be much appreciated. i42.tinypic.com/16libh0.gif here is the nav- notice the slice width is correct and the images are aligned, it is just that the slice happens in the wrong place.( u need to input the htt* bit ) Hi, I have been working on a site that went live today. I have just been alerted of a problem by the client. On the front page I have an alignment issue in IE6 (and perhaps lower) www.formulation.org.uk I can't work out how to sort it. Any suggestions would be appreciated. I am on a mac so don't have the facilities to check often. Thanks all Tom Hello everyone! I'm new here, but I'm not new to CSS! I've built a website out of HTML, CSS, and Java Script. I want to add some side boxes (navigation on sides) for quick navigation... But I am having a problem... See the example page cfpmedia DOT COM / 2.0 As you can see... There is a bunch of text encased within a border. The title is Side Bar. I need to know how to make it so the Side Bar is aligned with the Main border (the body). I want to do this... Example... ________ ________ |Side Bar| | Body | | | | | |_______| |_______| I would like to know how to make them both perfectly aligned. Here is my CSS Code... body {background-color:#B2CC7C} body {color:black} body {text-align:center} body {font-family: Comic Sans MS} h3 {font-size:50px} p.subject {font-size:20px} p.subject{text-align:left} p.body { border-style:solid; border-width:1px; border-color:#000000; background-color:#BED490; margin-top:0px; margin-bottom:50px; margin-right:85px; margin-left:85px; } p.navbar { border-style:solid; border-width:1px; background-color:#BED490; margin-top:0px; margin-bottom:50px; margin-right:200px; margin-left:200px; } p.module { border-style:solid; border-width:1px; border-color:#000000; background-color:#BED490; margin-top:0px; margin-bottom:50px; margin-right:85%; margin-left:-45px; } The P.Module is the one that controls the side bar, and the P.Body controls the body. First of all, I know that my CSS is hideous and I have a ways to go in terms of coding. However, given the time I have, I've done my best for the time being. I recently launched a beta for my portfolio site and although everything was tested and working on my Mac (Opera, Safari, and Firefox), I noticed problems when testing it on a Windows machine and several versions of IE. First of all, here's the link: hellomynameisad.am Second, here are screen grabs of my Mac/Firefox and a PC/IE7. You'll notice that the padding between lines on the Mac screen grab is tight and neat whereas the space is wider and not even on the PC/IE7. Second, you'll notice that the rules extend the entire width of the white boxes on the Mac whereas they are short of 100% on the PC/IE7. Hopefully someone can lend a hand and help. Thanks! hellomynameisad.am/mac - firefox.png hellomynameisad.am/pc - ie.png Hi, I'm having an issue getting my body background image to show a line that runs vertically down the sides. It shows in FF, but it doesn't show the left vertical line in IE or Chrome. The content is covering it up, and anytime I try making the overall width smaller in width, the content background color/area keeps aligning to the left and thus covering up my left border. Doh. Link: http://aries.addaction.net/~copeland/ Another issue is that there's a big gap separating the content from the footer. I think I've had this problem in the past, but unfortunately don't remember how to remedy the issue. I've tried and tried, but keep gettin' denied. Any thoughts on either of these obstacles? Thanks in advance. I love this forum. I'm trying to figure out why the three titles and info are being listed down. I want them all to be listed across. http://kansasoutlawwrestling.com/champions I am in the process of building out this site: ( gosandbox dot com/smack/ ) My navigation is displaying a few pixels different between Firefox and Safari/Chrome. I have gone in and tried to tweak everything I can think of to no avail. Basically what I am seeing is that on the far right of the page/main nav on hover, everything aligns perfectly in Firefox. In Safari/Chrome, it's off about 10px. Any ideas on what is wrong here that I am missing? Thanks in ADVANCE!!!!! So I have been trying to troubleshoot this issue for days and can't come up with a solution. I hope someone out there can help!! So my navigation image sprite is not displaying correctly in IE7 or 6. It basically shows the whole sprite image scrunched up into the defined 100px height of the <ul>. Also, the sprite image has a width of 930px but in Firefox it begins to repeat the image even though the <ul> width is 930px. So I added the no-repeat to the background image sprite. Now it's not centered on the page. What's up with this? Also, I am trying to display the pictures on the page with one large pic on the left and then 4 images to the right of the large image. You'll have to see it to understand. It displays perfectly how i want in Firefox...and of course IE7 and 6 are all out of wack. Not sure what I am doing wrong here as well. I used a grid system, but it is not locking it in like it normally does. You can see the sprite and alignment issues if you view in IE 7 and how I want it to look in Firefox. Here's my coding: HTML: Code: <body id="pretty-pics"> <div id="container"> <div id="navigation"> <ul id="nav"> <li id="home"><a href="/">home</a></li> <li id="essence"><a href="../essence.html">essence</a></li> <li id="pictures"><a href="/pretty-pictures.html">pretty pictures</a></li> <li id="treasures"><a href="/treasures.html">treasures</a></li> <li id="contact"><a href="/contact.html">contact</a></li> </ul> </div><!--end nav--> <div class="clear"></div> <div class="pic-wrap col12"> <div class="col5 float-left"> <a href="images/products/product-1.jpg" rel="shadowbox[products]" title="Necklace"><img id="product-1" src="images/products/product-1-t.png" /></a> </div> <div class="col7 float-right"> <div class="col4 float-left"> <a href="images/products/product-2.jpg" rel="shadowbox[products]" title="Bracelet"><img id="product-2" src="images/products/product-2-t.png" /></a> <a href="images/products/product-4.jpg" rel="shadowbox[products]" title="Bracelets"><img id="product-4" src="images/products/product-4-t.png" /></a> </div> <div class="col3 float-right"> <a href="images/products/product-3.jpg" rel="shadowbox[products]" title="Necklaces"><img id="product-3" src="images/products/product-3-t.png" /></a> <a href="images/products/product-5.jpg" rel="shadowbox[products]" title="Necklaces"><img id="product-5" src="images/products/product-5-t.png" /></a> </div> <div class="clear"></div> </div> </div><!--end main wrapper--> CSS: Code: #pretty-pics{ background: #32b4c9 url(images/wall-bg.jpg) no-repeat scroll center 0px; } /* Main Navigation */ #nav{ width: 930px; height: 100px; background: url(images/sprite.png) no-repeat; margin: 20px auto; position: relative; } #nav li{ margin: 0; padding: 0; list-style: none; position: absolute; top: 0; text-indent: -9999px; } #nav li, #nav a{ height: 100px; display: block; } #home{ left: 0; width: 186px; } #essence{ left: 186px; width: 186px; } #pictures{ left: 372px; width: 186px; } #treasures{ left: 558px; width: 186px; } #contact{ left: 744px; width: 186px; } #home a:hover{ background: transparent url(images/sprite.png) 0 -104px no-repeat; } #essence a:hover{ background: transparent url(images/sprite.png) -186px -104px no-repeat; } #pictures a:hover{ background: transparent url(images/sprite.png) -372px -104px no-repeat; } #treasures a:hover{ background: transparent url(images/sprite.png) -558px -104px no-repeat; } #contact a:hover{ background: transparent url(images/sprite.png) -744px -104px no-repeat; } #essence a.current{ background: transparent url(images/sprite.png) -186px -208px no-repeat; } #pictures a.current{ background: transparent url(images/sprite.png) -372px -208px no-repeat; } #treasures a.current{ background: transparent url(images/sprite.png) -558px -208px no-repeat; } #contact a.current{ background: transparent url(images/sprite.png) -744px -208px no-repeat; } /* Pictures */ .pic-wrap{ height: 550px; margin: 50px auto; } #product-1{ margin: 10px 0 0; } #product-2{ margin: 10px 50px 0; } #product-3{ margin: -40px 20px 0; } #product-4{ margin: 20px 70px 0; } #product-5{ margin: 30px 0 0; } ANY help is appreciated. I am tired of pulling my hair out over this one! Thanks in advance!!! Example Screenshot and Entire File When you view the screenshot, you will notice that the two columns are obviously not flush with eachother.. I can't seem to fix this minor issue, though (as far as I can tell) the offset only happens when I manually resize the window.. if I resize the window, close it, and then reopen it, the offset does not occur and all is well, but there is still the chance of somebody resizing the window and getting that weird effect. I have a custom list where the list elements will show horizontally across a row until they can't, and then bump down to the next row. I use it for a gallery of pictures. The problem is, there is all this extra padding on the left of the list for some reason that I can't seem to get rid of. I'm not sure what is causing this. I attached the picture and here is the CSS for the <ul> tag Code: .photolistitem { position: relative; display: block; float: left; list-style-type: none; height: 140px; width: 140px; padding: 5px; border: solid 1px black; margin: 5px; background: white; text-align: center; } Here is the HTML. There is PHP in there to get each photo Code: <ul id="sortable"> <?php $pics = $DB->query("SELECT * FROM pictures WHERE gallery_id='".$gallery['id']."' ORDER BY position ASC"); $num = $DB->rows(); if ($num > 0) { while ($pic = $DB->fetch()) { ?> <li class="photolistitem"> <table> <tr> <td class="imageCell"> <a rel="group" class="gallerypiclink" href="pictures/<?php echo $pic['filename']; ?>" title="<?php echo $pic['caption']; ?>"><img class="gallerypic" name="<?php echo $pic['filename']; ?>" galleryid="<?php echo $pic['gallery_id']; ?>" src="pictures/thumbs/<?php echo $pic['filename']; ?>" width="<?php echo $pic['thumb_width']; ?>" height="<?php echo $pic['thumb_height']; ?>"></a> </td> </tr> <tr> <td> <p> <a href="#" class="delete">Delete Picture</a><br /> <a href="#" class="editCaption">Edit Caption</a> </p> </td> </tr> </table> </li> <?php } } else { echo "<p id=\"none\">No images uploaded yet</p>"; } ?> </ul> There is just one table around the list with only the list in it. I made the bgcolor of it blue to highlight the issue. Thanks Hi, Just wondering it anyone can help... I am trying to get my left hand navigation to sit at the top of the cell and no matter what I change it won't budge! You can see what I am working on at www. freedomwhalewatch .com.au /Stirling /index.html as you can see the left hand navigation is sitting towards the bottom... anyone have any suggestions as to how I would move it up to be directly underneath the logo? To see my working files just use the right click and view page source. Any help or suggestions would be much appreciated. I am a newbie to css! Cheers, Jen ** UPDATE - sorry guys i spelt the url incorrectly! http://www. freedomwhalewatch .com.au/Stirling /index.html Hello all, I have a really anoying alignment issues with fire fox and IE. Have a look at the follwoing page in both browsers: http://pfwd.org.uk/style.htm I need to get IE to display what Firefox shows. The four rows on the left hand side (date, date value, number and number value) need to be aligned with the rows Descirption and description value. Please note not all style code is in the external stylesheet external CSS file: PHP Code: body{ background-color:#006699; font-family:Arial, Helvetica, sans-serif; } .main, header, subHeader{/*Positon values that make every thing go inside the main box */ position:absolute; left:100px; } .main, subHeader dbItem{ border: solid 1px #0099CC; } .main, header{ top:125px; left:140px; width:451px; } .main{ height:300px; } .header{ background-color:#0099CC; font-size:12px; font-weight:800; } .subHeader{ height:22px; width:200px; border: solid 1px #0099CC; background-color:#FFCC66; float: left; font-size:10px; font-weight:700; padding: 2px; } .dbHeader{ border: solid 1px #0099CC; background-color:#FFCC66; font-size:10px; font-weight:600; padding: 2px; width: 50px; } .dbItem{ background-color:#FFFFFF; border: solid 1px #0099CC; font-size:10px; font-weight:700; padding: 2px; width:50px; } .dbdescripHeader{ border: solid 1px #0099CC; background-color:#FFCC66; font-size:10px; font-weight:600; padding: 2px; width: 364px; float:right; } .dbdescripItem{ background-color:#FFFFFF; border: solid 1px #0099CC; font-size:10px; font-weight:700; padding: 2px; width:50px; width: 390px; float:right; height:48px; } .link{ font-size:11px; font-weight:700; font-family:Arial, Helvetica, sans-serif; padding:2px; color:#0099CC; text-decoration:none; float:right; } .links{ background-color:#006699; border: 1px solid #0099CC; border-top:1px solid #0099CC; color:#0099CC; text-decoration:none; padding:0 2px; } .link a:hover{ font-size:11px; font-weight:700; font-family:Arial, Helvetica, sans-serif; padding:0 2px; text-decoration:none; color:#FFCC66; background-color:#006699; } br{ margin-top:-15px; } .subsubheader{ border: solid 1px #0099CC; background-color:#FFCC66; float: left; font-size:10px; font-weight:700; padding: 2px; } page file: PHP Code: <!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> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="style.css"type="text/css" /> </head> <body> <div class='main'> <div class='header'>Updates to the site</div> <div style='margin-bottom:20px;'> <div class='subHeader' style='height:22px;'>Search for an update</div> <div class='dbItem' style='left:180px; width: 239px; float:left; height:22px;'> <form name="search" method="post" action="post"> <select name="Year"> <option>Year</option> <option>2005</option> <option>2004</option> <option>2003</option> <option>2002</option> <option>2001</option> <option>2000</option> </select> <select name="Month"> <option>Month</option> <option>January</option> <option>Febuary</option> <option>March</option> <option>April</option> <option>May</option> <option>June</option> <option>July</option> <option>August</option> <option>September</option> </select> <input type="submit" name="Submit" value="Search" /> </form> </div> </div> <div style='margin-bottom:10px;'> <div class="link"><a href='#' class='links'>GO</a></div> <div class='dbdescripHeader'>Description of update</div> <div class='dbdescripItem'>First set of information from the database</div> <div class='dbHeader'>Number</div> <div class='dbItem'>one</div> <div class='dbHeader'>Date</div> <div class='dbItem'>10/01/01</div> </div> <div style='margin-bottom:10px;'> <div class="link"><a href='#' class='links'>GO</a></div> <div class='dbdescripHeader'>Description of update</div> <div class='dbdescripItem' >Second set of information from the database</div> <div class='dbHeader'>Number</div> <div class='dbItem'>two</div> <div class='dbHeader'>Date</div> <div class='dbItem' >10/01/01</div> </div> <div style='margin-bottom:10px;'> <div class="link"><a href='#' class='links'>GO</a></div> <div class='dbdescripHeader'>Description of update</div> <div class='dbdescripItem'>third set of infroamtion from the database</div> <div class='dbHeader'>Number</div> <div class='dbItem'>three</div> <div class='dbHeader'>Date</div> <div class='dbItem'>10/01/01</div> </div> <!-- End on the fly scripts --> </div> </body> </html> URLS css: http://pfwd.org.uk/style.css page: http://pfwd.org.uk/style/htm Can any one help me sus out the alignment issues? thanks pfwd I am having consistent alignment issues with IE7. I am uncertain as to what the issue could be. Any help, assistance or a link to some reference would be greatly appreciated. 1) . The line at the top of the screen and the tabs do not line up properly. The line transects the buttons. standardizedsupplements{dot}com 2) Image and Text are not aligned on same line: standardizedsupplements.com/tremorsure.html standardizedsupplements.com/purchase_tremorsure.html 3) Gif/Arrow to right side panel list ( <li> ) is not consistent showing up on all lists. standardizedsupplements.com/contact-us.html 4) In the FAQs, at the very top of the page, the numbers and the text overlap, when there are double digits. standardizedsupplements.com/faq.html I'm using a background image but am having a hard time indenting the text. Code: ul.leftside li { font: bold 11px Helvetica,sans-serif; color: #FFF; background: url(images/left_menu-bg.jpg) no-repeat; margin: 7px 10px 5px 4px; list-style-type: none; } <ul class="leftside"> <li> Rooms</li> <li>Reservations</li> <li>Siteseeing</li> <li>Contact Us</li> </ul> The only way I can move the text over is by adding the non-binding spaces and I can't seem to get a style to work in the line item either. Thanks in advance! Ok, I have a menu (that I did not build, that I got from a template) that I cannot seem to figure out how to center the text in, and it's driving me crazy. I have done the validation, and debugged it as much as I can, but I'm not a css guru, so I was hoping someone here can help me. I feel like I've tried everything. So you can see the menu at www.eliteoutfittersutah.com/new. The menu at the top I am desperate to center. I have been able to modify everything else through the css, but just can't seem to get the text alignment centered. I have checked the js files as well, but don't think it's in there. I think it just might be missing a tag? Any help would be GREATLY appreciated. The styles.css is (and of course you can view the page code from the page itself when you look at the menu): Code: @charset "utf-8"; /* CSS Document */ /* Easy Slider */ a:link { color:#333333; text-decoration: none; font-weight: bold; } a:active { color:#333333; text-decoration: none; font-weight: bold; } a:hover { color:#052807; text-decoration: none; font-weight: bold; } a:visited { color:#333333; text-decoration: none; font-weight: bold; } a:visited:hover { color:#052807; text-decoration: none; font-weight: bold; } #slider ul, #slider li, #slider2 ul, #slider2 li{ margin:0; padding:0; list-style:none; } #slider2{ margin-top:1em; } #slider li, #slider2 li{ /* define width and height of list item (slide) entire slider area will adjust according to the parameters provided here */ width:1018px; height:336px; overflow:hidden; } /* numeric controls */ ol#controls{ margin:3px 0; padding:0; padding-left:10px; height:20px; } ol#controls li{ margin:0 10px 0 0; padding:0; float:left; list-style:none; height:20px; line-height:20px; } ol#controls li a{ float:left; height:20px; line-height:20px; border:1px solid #ccc; background:#d3d3d3; color:#555; padding:0 5px; text-decoration:none; } ol#controls li.current a{ background:#052807; color:#FFFFFF; } ol#controls li a:focus, #prevBtn a:focus, #nextBtn a:focus{outline:none;} /* // Easy Slider */ .lavaLampWithImage { position: relative; height: 68px; width: 1018px; overflow: hidden; background-image: url(../images/navbg.png); background-repeat: no-repeat; background-position: top; padding-top: 15px; padding-left: 0px; } .lavaLampWithImage li { float: left; list-style: none; } .lavaLampWithImage li.back { background: url("../images/lava.png") no-repeat right -34px; width: 9px; height: 34px; z-index: 8; position: absolute; } .lavaLampWithImage li.back .left { background: url("../images/lava.png") no-repeat top left; height: 34px; margin-right: 9px; /* 7px is the width of the rounded shape */ } .lavaLampWithImage li a { font: 17px arial; font-weight: bold; text-decoration: none; color: #FFFFFF; outline: none; text-align: center; top: 7px; text-transform: uppercase; letter-spacing: 0; z-index: 10; display: block; float: inherit; height: 34px; position: relative; overflow: hidden; margin: 0 12px; } .lavaLampWithImage li a:hover, .lavaLampWithImage li a:active, .lavaLampWithImage li a:visited { border: none; } body { background-image: url(../images/bg.gif); background-repeat: repeat-x; } body, html { height: 100%; margin: 0; } #st2, #st3 { display: none; } #wrapper { width: 1018px; margin: 0 auto; font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: #333333; } #topbar { height: 22px; margin-top: 5px; padding: 5px; } #skin { float: right; width: 180px; text-align: right; font-size: 11px; text-transform: uppercase; } #skin ul { margin: 0px; padding: 0px; } #skin li { list-style-type: none; display: inline; padding-left: 10px; padding-right: 10px; } #skin a:link { text-decoration: none; color: #FFFFFF; } #skin a:visited{ text-decoration: none; color: #FFFFFF; } #nav { height: 90px; } #header { height: 370px; font-size: 11px; } #content { padding: 10px; clear: both; margin-bottom: 10px; overflow: hidden; } #footer { background-image: url(../images/footer.jpg); background-repeat: no-repeat; height: 80px; width: 1010px; text-align: center; padding-top: 20px; clear: both; color: #FFFFFF; } #left { float: left; width: 670px; } #right { float: right; width: 260px; padding-left: 30px; border-left-width: 1px; border-left-style: solid; border-left-color: #CCCCCC; } .brownheadline { font-size: 35px; font-weight: bold; color: #ab4d1b; letter-spacing: -1px; line-height: 30px; } .greenheadline { font-size: 35px; font-weight: bold; color: #052807; letter-spacing: -1px; line-height: 30px; } .browntitle { font-size: 42px; font-family:"Times New Roman"; font-weight: bold; color: #ab4d1b; letter-spacing: -1px; line-height: 30px; } .greentitle { font-size: 42px; font-family:"Times New Roman"; font-weight: bold; color: #052807; letter-spacing: -1px; line-height: 30px; } .leftimg { float: left; padding-right: 15px; display: block; } .greentext { font-weight: bold; color: #052807; } .browntext { font-weight: bold; color: #36a0e7; } .style1 { color: #6A2C0D; } .greyline { background-color: #CCCCCC; height: 1px; margin: 8px 0 8px 0; } #contact { color: #696969; padding: 5px; } #contact input { font-family: Arial, Helvetica, sans-serif; font-size: 14px; padding: 6px; border: 1px solid #696969; width: 250px; margin: 5px 0 5px 0; } #contact label { float: left; width: 80px; display: block; padding: 3px; margin: 3px 0 3px 0; clear: both; } #contact textarea { border: 1px solid #696969; font-family: Arial, Helvetica, sans-serif; font-size: 14px; padding: 6px; width: 250px; margin: 5px 0 5px; } I want some text aligned left, then some text aligned center, then some more text aligned right all on the same line. Should I use tables, divs, or is there a better way? Thanks In Firefox, my text will align perfectly. However, IE will not show the text in the proper spot and I can't come up with a way to over come this. Heres my css document: /* CSS Document */ #header { margin: auto; background-image:url(images/header.jpg); width:800px; height:158px; left: auto; top: auto; right: auto; bottom: auto; background-position: center; } #headernav { font-family: "Times New Roman", Times, serif; font-size: 14px; font-style: normal; color: #4B60AF; font-weight: normal; word-spacing: 12px; margin-top: -42.5px; margin-right: auto; margin-bottom: auto; margin-left: auto; any suggestions? BTW the text is in headernav Alright, first post in a while, let me see if I can make this clear and simple so I can fix this issue. I am making a website for my history project. I have made the website solely by hand and using an HTML editor; I have quite a bit of knowledge in CSS and HTML, but really, this is a great learning process for me. The website design is laid out in table form. There are just two columns, a sidebar and the main content column. The text causes the table to be stretched out (you can see this by changing the border to "1" and viewing the table. However, when the main text strechtes the table, the side bar moves with it, settling in the center of the smaller column. The entire thing creates a problem like this: My History Website The source code for the site can be checked through your browser, or if you are too lazy, this is what I have written: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>History Through The Ages: 1865-1900</title> <meta name="generator" content="TextMate http://macromates.com/"> <meta name="author" content="Ethan Mick"> <!-- Date: 2008-05-21 --> <!-- I will eventually put this style sheet into its own external CSS file.--> <style type="text/css"> <!-- body { background:gray; } p { color:white; text-align:left; position:top; text-indent:1cm; vertical-align:top; } h2 { color:black; text-align:center; } .sidebar { position:relative; } .ads { display:block; margin-left:auto; margin-right:auto; } .imageright {float:right;} .imageleft {float:left;} --> </style> </head> <body> <img src="file:///Volumes/FAT32DATA/OmniEthan/School/US%20&%20World/History%20Logo.jpg" title="History Through The Ages" alt="History Logo" width="800"> <table width="800" border="0"> <tr> <td width="150" height="300"> <a class="sidebar" href="file:///Users/Ethan/Sites/History%20Website/Historysite.html">Home</a><br /><br /> <a href="file:///Users/Ethan/Sites/History%20Website/1856-1900.html">1865-1900</a><br /> <a href="file:///Users/Ethan/Sites/History%20Website/1901-1920.html">1901-1920</a><br /> <a href="file:///Users/Ethan/Sites/History%20Website/1921-1940.html">1921-1940</a><br /> <a href="file:///Users/Ethan/Sites/History%20Website/1941-1960.html">1941-1960</a><br /> <a href="file:///Users/Ethan/Sites/History%20Website/1961-1980.html">1961-1980</a><br /> <a href="file:///Users/Ethan/Sites/History%20Website/1981-2000.html">1981-2000</a><br /> <a href="file:///Users/Ethan/Sites/History%20Website/2001-Current.html">2001-Current</a><br /> <a href="file:///Users/Ethan/Sites/History%20Website/Bibliography.html">Bibliography</a><br /> <a href="file:///Users/Ethan/Sites/History%20Website/Genealogy.html">Mick Family Genealogy</a><br /><br /> <a href="http://www.mozilla.com/en-US/firefox/"><img class="" border="0" alt="Firefox 2" title="Firefox 2" src="http://sfx-images.mozilla.org/affiliates/Buttons/firefox2/firefox-spread-btn-1b.png"/></a> </td> <td width="*"> <h2>Emerging from the Civil War to the turn of the century<br />1865 to 1900</h2> <img class="imageright" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/DeadUnionsoldiercivilwar.jpg/250px-DeadUnionsoldiercivilwar.jpg" title="A dead soldier in Petersburg, Virginia 1865. Photograph by Thomas C. Roche"> <p>The United States emerged as a whole country from the Civil War, thanks to Abraham Lincoln and the union army, although not without consequences. Over half a million people were killed in the war. The United States' primary goal at this point was reconstruction from the war, and a lot of work had to be done in the south.</p> <p>This time period set up the United States for many years to come. During the reconstruction the United States began to industrialize, creating thousands of miles of new infrastructure, and machinating a lot of jobs which had to be done by hand before. The industrialization allowed huge corporations to be formed, like Standard Oil created by John D. Rockefeller in 1870 and Carnegie Steel Company created by Andrew Carnegie in the mid 1870's, many of which gained a monopoly in the market. The industrialization allowed the United States to get back onto her feet quicker, as the new businesses could gain a lot of income by exporting their goods on the new infrastructure.</p> <p>The South wasn't happy about losing the war, and it wasn't happy about being back in the union. During reconstruction many groups of people made clandestine acts against the government, and some others made their attacks public, such as the KKK. The reconstruction acts involved the dismantling of southern governments, and the southern states were only allowed to have their own government after the majority swore a loyalty oath to the Union, and they ratified the new amendments, the 13th, 14th, and 15th. Even then, once the southern people regained their own governments, everything that the North had been fighting for, rights of African-Americans, were largely ignored, and the African-Americans had to suffer even more discrimination. To make matters worse, the courts ruled in Plessy vs. Ferguson that segregation was legal on the premises of "separate but equal."</p> <img class="imageleft" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/14/USS_Maine_h60255a.jpg/300px-USS_Maine_h60255a.jpg" title="USS Maine - Wikimedia Commons"> <p>To heal the scars which had been formed in the Civil War, the United States decided to jump aboard the imperialistic boat, and attacked the weakened Spanish empire, fighting Spain for Peurto Rico, the Philippines, Guam, and Cuba. The war was extremely single sided, with the United States decimating the Spanish fighters on almost all fronts. The only interesting points of the war was the Philippines and Cuba. In the Philippines, native freedom fighters had been fighting the Spanish for a long time, and they viewed the Americans as saviors coming to help their cause. However, when it became apparent that the American's weren't going to leave, they became angry and fought us as well. In Cuba, Roosevelt would lead the "Rough Riders" to fight the against the spanish with some Cuban help.</p> <p>My family on both sides was in the United States at this point, but I am not positive where they were. My family was not seriously affected by the segregation and racism partaking in the south during this time; indeed, my ancestors who moved to the United States in 1730 opposed slavery. Seeing the cruelly and imbalance in South Carolina, where they landed, they moved to Illinois. This affected Grandma Lori, my mother's mom, and her attitude on life.</p> </td> </table> <img class="ads" src="file:///Users/Ethan/image_1.png"> </body> </html> I recently added the "sidebar" class, trying to bring the links up, as you can see with the one I tested it on. Didn't work. I have tried other ideas, but I nothing worked. Also, if you have some advice (that doesn't require me completely rewrite the site) feel free to ring it by me. So my question is, without doing anything repetitive or stupid, and preferably with CSS, how can I cause the text (the links) in the sidebar to align to the top of the page, and make it look nice. If you need more information, lemme know. |