CSS - Image Breaking Table Alignment
This post can be deleted, I solved my problem.
Similar TutorialsI inherited a big huge site; so there is way much going on; this is a simplification... I am trying to use CSS to divide it into columns, with a column as a div. For debugging, I draw a border around the columns to show me the boundaries. But when I include the following code within the column div: Code: <div class="mycolumn"> <p>Hi, I'm in the Div!</p> <table><tr><td><p> I'm in the table</p> </td></tr></table> <p>Hi, I'm after the table; I would expect to still be in the div</p> </div> The bottom border of the div is drawn right beneath the words "Hi, I'm in the Div", and both "I'm in the table" and "I'm after the table" are outside the box boundary. This does NOT happen if I create a separate test html file and include my Column CSS, but it does happen withing the application. Now, what's going on in the application is extremely complex, involving dozens of included CSS files, javascript, smarty templates which include other smarty templates, and over 4000 files in all. Could one of the other CSS files or something else be redefining <td> somehow, or any other obvious thing that could be breaking the div? Obviously, I keep trying to debug it, but if any old hand has an explanation that might save me another 8 hours, that would be greatly appreciated. Thanks, Chris Code: #ticker { background: transparent url('../images/dark_gradient.png'); overflow: hidden; display: table; margin-left: 20px; margin-top: 10px; width: 835px; height: 52px; } #ticker #items { position: relative; top: 0px; left: 829px; } the point is to use javascript to scroll the #items div along the container (#ticker). now, using this method, overflow: hidden does not seem to be working correctly. (i know display: table only works in FF, but this is an internal tool, so no need to make IE fixes yet) ... now, when i change display: table to display: block, the overflow works, but now the #items div is no longer relative to the container, but relative to the window. hi all... i have a table cell "td" with 3 divs in it. what i need is to get it to align the top div to the top, middle div to the middle and 3'ed div to the bottom... this is all fine but i cant get to do that, and the auto increase height on the middle one dont work ? btw: this is for the IE style sheet, mozilla(firefox) works great.... frank/ So I have a calendar that I created in PHP and I'm displaying it in a table and I'm having trouble aligning the title and the two image arrows that go on either side of it. I'm trying to align everything vertically in the middle of the row and it seems that in Firefox, the Title is lower than the two arrows, but in Chrome and IE it seems to be right in the middle where it should. How do I solve this? Code: <table border="0" cellpadding="0" cellspacing="0"> <tr> <td class="cal_left_arrow"> <img src="/images/left_arrow2.jpg" width="9px" height="13px" onClick="displayCalendar(<?php echo $prevYear; ?>, <?php echo $prevMonth; ?>);" /> </td> <td class="cal_title" colspan="5" valign="middle"> <?php echo date('F', mktime(0,0,0,$month,1,$year)).' '.$year; ?> </td> <td class="cal_right_arrow"> <img src="/images/right_arrow2.jpg" width="9px" height="13px" onClick="displayCalendar(<?php echo $nextYear; ?>, <?php echo $nextMonth; ?>);" /> </td> </tr> Code: #event_calendar { margin-top:50px; margin-bottom:20px; float:left; height:auto; width:245px; } .calHeaderDays { font: bold 10px Arial, Helvetica, sans-serif; background-color: #3F4C6B; text-align:center; height: 20px; width:245px; color: white; overflow:visible; /*border: 1px solid #3F4C6B;*/ } .cal_title { text-align: center; font: bold 16px Arial, Helvetica, sans-serif; color: #C79810; height:40px; vertical-align:middle; } .cal_left_arrow { text-align:right; height:40px; vertical-align:middle; } .cal_right_arrow { text-align:left; height:40px; vertical-align:middle; } table { width: 245px; font-family: Arial, Helvetica, sans-serif; background-color: white; border-collapse: collapse; } table img { cursor: pointer; cursor: hand; } .calToday { height: 28px; vertical-align: middle; background-color: #3F4C6B; color: #fff; font-weight:bold; text-align:center; font-size: 10px; } .slDay { height: 28px; font-size: 10px; width: 14%; font-family: Arial, Helvetica, sans-serif; vertical-align: middle; text-align:center; } Hello, I am attempting to have two pieces of text within a table cell that also contains an image. I was able to figure out the first piece of text that I wanted vertically aligned to the top and to the left, but the next piece of text, which I want vertically aligned to the bottom of the cell and aligned right I am having issues with. Here is the example code: Code: <td style"vertical-align: bottom;"><img src="image1.jpg" border="0" width="195"><font style="position: absolute;left: 2;background-color: #FFFFFF; color: #000000;font-weight: bold;font-size: 18px;">STYLE#</font><font style="position: absolute;right: ;background-color: #FFFFFF; color: #000000;font-weight: bold;font-size: 18px;">As low as $x.xxfont></td> Is this possible within the same table cell as the image? Or do I have to place a CSS table within this cell to place text over top of the image? I would have placed the image as the cell background image, however, I am dynamically creating these tables, and not all of my images are of same size. I am specifying the width though, just not the height. Thank you in advance. Hi guys, I was hoping someone could help? I have the following css which controols the style for a larger image on hover function. (thumb - then large pic on hover) I am having trouble positioning (vertically) the image, what can I usew to control it? Code: /* Popup Image Viewer */ .thumbnail{ position: relative; z-index: 0; } .thumbnail:hover{ background-color: transparent; z-index: 50; } .thumbnail span{ /*CSS for enlarged image*/ position: absolute; background-color: #669933; padding: 1px; left: -1000px; border: 1px ridged; visibility: hidden; color: black; text-decoration: none; } .thumbnail span img{ /*CSS for enlarged image*/ border-width: 0; padding: 2px; } .thumbnail:hover span{ /*CSS for enlarged image on hover*/ visibility: visible; top: 0; left: 135px; /*position where enlarged image should offset horizontally */ } hi i am trying to position some images in this box... #rightColumn { float: right; padding: 0px; margin:0 12px 0 15px; background: #F2FCFF; width: 350px; } there are 3 images and i wany them to go from left to right accross the box using this tutorial as inspiration. however, rather than use margins to space the images (this screws up what i am trying to achieve) i wanted to use css alignment i.e. leave the first image alone, centre the second and align right the third. I can't figure how to do it though... i've tried a couple of things but i still pretty wet behind the ears so don't have too much experience to draw upon.... i tried <div class="button"><img src="images/school-uniform-button.gif" alt="school uniforms" name="uniform" width="107" height="107" id="uniform"><div class="centre"><img src="images/school-equipment-button.gif" alt="classroom equipment" name="equip" width="107" height="107" id="equip"></div> <div class="jumpmenu"><img src="images/fees-button.jpg" alt="School fees" name="fees" width="107" height="107" id="fees"></div></div> and also with the <div class="button"> next to each image with the alignment divs. neither works and advice would be really appreciated thanks jim. Nevermind, folks over at codingforums helped me. Hi. K, I have NO idea where to begin on this one. I need to display a series of thumbnails (to be selected dynamically from a database) inside 1 <td> tag. I need them to be organized 3 wide by 3 high, with their titles underneath. What would I use for this? I"m assuming I just set up a new class for that, but I don't know what to do for it. Any help is greatly appreciated. I'm really hung up on what class alignments I need to alter in order to get my thumbnails to align properly. If my thumbnails span the width of my page width, they are justified, but if they do not, they align left. The forum isn't letting me post a link to an example, but my website is at www dot the312hole dot com. The latest post shows an example of what I'm talking about with the thumbnails at the bottom of the post. Any advice on how to get them to always space evenly? Preferably with a predefined margin and padding that spaces them equally regardless of how many are in each row? Thanks for the help! Okay, I'm no newbie on using CSS but the long story short is that I bought software for a shopping cart and had to use their pre-made template in order to keep the peace. I of course, being a web designer changed the template to my own liking, but can NOT get this header centered for the life of me! I have tried everything I know, including things I have looked up, nothing will work. Here is the main.css (only css file being used) Code: body { color: #ffffff; background-color: #000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; text-align: left; margin:auto; text-align:center; margin:0 auto; } a { color: #d92f2f; font-weight: normal; text-decoration: underline; cursor: pointer; } p { margin: 0px 0px 7px 0px; } sup { display: inline; padding: 0px; vertical-align: super; font-size: 8px; } a:hover { color: #ffb4b4; } legend { display: none; } label { display: none; } fieldset { border: none; padding: 4px 0px 4px 5px; } fieldset p { display: block; margin: 5px 5px 5px 2px; } form { margin: 0px 0px 5px 0px; } img { border: none; } li { padding-bottom: 5px; } /* +------------------------------------------------------------+ */ /* | General XHTML Classes | */ /* +------------------------------------------------------------+ */ .center { text-align: center; } .inlinecenter { text-align: center; } p.inline { display: inline; padding: 0px; } .strong { font-weight: bold; } .big { font-weight: bold; font-size: 16px; } .hidden { display: none; } a.unfancy { color: #d92f2f; font-weight: normal; text-decoration: underline; cursor: pointer; } /* +------------------------------------------------------------+ */ /* | Skin Specific Divs | */ /* +------------------------------------------------------------+ */ #skin_header { height: 230px; width: 899px; margin:auto; padding: 0px; background-position: center top; } #skin_wrapper { width: 910px; padding: 0px; margin:auto; } #skin_wrapper_full { width: 100%px; padding: 0px; margin:auto; background-image: url('../media/header.png') background-repeat: repeat-x; background-position: top left; } #skin_ct { width: 100%; padding: 0px; margin: auto; border-spacing: 0px; border-collapse: collapse; } #skin_ct_lcol_head { font-size: 16px; font-weight: bold; padding: 10px; margin: auto; width: 160px; height: 80px; } #skin_ct_rcol_head { font-size: 16px; font-weight: bold; padding: 10px; margin: auto; height: 80px; text-align: right; } #skin_ct_lcol { padding: 20px 10px 10px 10px; margin: 0px; vertical-align: top; width: 160px; text-align: left; } #skin_ct_mcol { padding: 20px 10px 10px 10px; margin: 0px; vertical-align: top; line-height: 150%; } #skin_ct_rcol { padding: 2px 10px 10px 10px; margin: 0px; vertical-align: top; width: 160px; } #skin_footer { color: #FFFFFF; background-color: #000000; padding: 50px 10px 10px 10px; margin: 0px; text-align: center; background-image: url('../media/footer.png'); background-repeat: repeat-x; background-position: top left; } #skin_pgtitle { font-size: 16px; padding: 0px 0px 4px 0px; margin: 0px 0px 10px 0px; font-weight: bold; border-bottom: 1px solid #999999; } #skin_content { margin: auto; } There is more coding but the actual image header is located inside of the #skin_header. Also, here is the PHP code where the SRC code is located: Code: </head> <body> <div id="skin_header" align="center"> <img src="skins/Default/media/logo.png" alt="Home" width="899" height="230" align="center" style="margin:auto;"/> </div> <div id="skin_wrapper_full"><div id="skin_wrapper"> <table id="skin_ct"> <tr> <td id="skin_ct_rcol_head" colspan="3"> <div id="skin_menu_head"> <ul> <?php if (!(empty($link_home))) {print '<li><a href="' . $link_home . '" title="Home">Home</a></li>';} if (!(empty($link_cart))) {print '<li><a href="' . $link_cart . '" title="Shopping Cart">Shopping Cart</a></li>';} if (!(empty($link_checkout))) {print '<li><a href="' . $link_checkout . '" title="Checkout">Checkout</a></li>';} if (!(empty($link_account))) {print '<li><a href="' . $link_account . '" title="Your Account">Your Account</a></li>';} if (!(empty($link_contact))) {print '<li><a href="' . $link_contact . '" title="Contact">Contact</a></li>';} ?> </ul> Please, ANY help would be appreciated, I want to get this site live, pronto. The link is www.PhantomSupplements.net thank you! Hi There, If you put images in in replacement for standard form buttons they don't align properly. I have been trying to move away from nested tables with my current work in favour of css layouts and was wondering if there is any quick and easy way to align button images? If you look at the following URL the 'add to basket' buttons are higher up thean they should be..... http://www.storesprite.org/taml/vie...l?category_id=3 Thanks I'm trying to get something that looks like this: Here is the xhtml: Code: <div id="container"> <div class="design_box"> <img src="images/image.png" alt="" /> <h1>Header goes here</h1> <p>Paragraph goes here</p> </div> <div class="design_box"> <img src="images/image.png" alt="" /> <h1>Header goes here</h1> <p>Paragraph goes here</p> </div> <div class="design_box"> <img src="images/image.png" alt="" /> <h1>Header goes here</h1> <p>Paragraph goes here</p> </div> </div> Here is the relevant css: Code: .design_box { display: block; margin-bottom: 17px; } #row_a_right_web_design img { float: left; } .design_box h1 { color: #fbfbfb; font: bold .9em Tahoma, arial, sans; margin-bottom: 4px; } .design_box p { color: #c4c2c2; } Needless to say, the above css does not produce the desired outcome. I'm having a serious brain-fart as to what the best way is to tackle this. Thanks in advance. Hello all, I am trying to make a horizontal nav bar using a list. Everything was going good until I tried to add an image (essential a line) to seperate each <li>. When I did this, the height of the nav bar expanded and it moved the entire list down about 15 pixels or so. I am attaching an image before I added the image and after I added the image to show. Here is my css code for before I add the image: PHP Code: #navbar { height:37px; line-height:33px; padding: 2px 0 0 10px; vertical-align:top; background: url(images/linkbarbg1.png) repeat-x; font-family: Tahoma, Georgia, "Times New Roman", Times, serif; font-size: 18px; color: #FFFFFF; } #navbar ul { vertical-align:top; margin:0; padding:0; border: 0px solid #000000; } #navbar ul li { display: inline; } #navbar ul li a { display: inline; text-decoration: none; padding-top: 5px; padding-bottom: 4px; padding-right: 10px; padding-left: 10px; color:#FFFFFF; } #navbar ul li a:hover { height: 31px; background:url(images/linkbarbg1hover.png) repeat-x top left; background-color: #FF3300; } And HTML: PHP Code: <div id="main"> <div class="leftshadow"> <div class="rightshadow"> <div id="header"><img src="images/logo1.png" /></div> <div id="navbar"> <ul> <li><a href="#">Milk</a></li> <li><a href="#">Eggs</a></li> <li><a href="#">Cheese</a></li> <li><a href="#">Vegetables</a></li> <li><a href="#">Fruit</a></li> </ul> </div> </div> </div> And here is what it looks like: My CSS Code is the same for after, here is my HTML code for after: PHP Code: <div id="main"> <div class="leftshadow"> <div class="rightshadow"> <div id="header"><img src="images/logo1.png" /></div> <div id="navbar"> <ul> <li><a href="#">Milk</a></li> <li><img src="images/linkbarseperator1.png" /></li> <li><a href="#">Eggs</a></li> <li><a href="#">Cheese</a></li> <li><a href="#">Vegetables</a></li> <li><a href="#">Fruit</a></li> </ul> </div> </div> </div> and here is what is looks like: Is there a way to fix this? UPDATE I have noticed the same thing happens even when it is not a list. Therefore, it must be due to some other factor...does anyone have any ideas? Sounds simple... but I can't find an answer. I've a simple table row with a css background image. In the row I've my text links and two images that are links. While in firefox everything lines up nice and straight... in intercrash exploder it's all over the place, the images are almost subtext and the text is almost text top.. Any advice? The page can be seen at addcolour (co uk extension) CSS in a folder css the file name is addcolour Many thanks d hi i have following xhtml Code: <body> <div id="content" class="centrehack"> <div id="header" class="centrehack"> <div id="topRightLogin"> <form action="#" method="post"> <input type="text" name="uname" value="username" /> <input type="password" name="passwd" value="password" /> <input type="image" src="images/headerlogin.gif" /> </form> </div> and following css Code: .centrehack { margin: 0 auto 0 auto; } #content { width:960px; text-align:center; height:100%; overflow:visible; background:url(images/headerback.gif) repeat-x; } #header { width:960px; height:47px; text-align:center; } #topRightLogin { width:450px; height:47px; float:right; color:#fff; font-weight:bold; font-family:Verdana, Geneva, sans-serif; border:#000 solid 1px; height:30px; display:block; padding:0; } #topRightLogin input,submit { display:inline; padding:0px; margin-left:5px; height:21px; margin-top:0px; } i want to display form fields and submit button in a single line with perfectly aligned horizontally. but the form fields are showing empty area above them and going down than the submit button. the problem remains same in all browser. i am attaching a screenshot of the problem as well. any help is much apprecated. thanks I'm trying to have a logo in a div next to a navigation menu that can align at a specific height in my logo. but im having a problem with my li background images staying within the ul background image. Can someone help me fix my code to align this properly? HTML CODE: 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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link href="style.css" rel="stylesheet" type="text/css" /> <!-- load the typeface.js library and typeface.js fonts --> <script src="js/typeface-0.14.js"></script> <script src="fonts/haettenschweiler_regular.typeface.js"></script> </head> <body class="oneColFixCtrHdr"> <div id="container"> <div id="header"> <div id="navigation" class="menu"> <ul id="top-nav"> <li class="item4"><a href="#" title="Contact">Contact</a></li> <li class="item3"><a href="#" title="About">About</a></li> <li class="item2"><a href="#" title="Ideas">Ideas</a></li> <li class="item1"><a href="#" title="Portfolio">Portfolio</a></li> </ul> </div> <div id="logo"><span><a href="http://www.nadesignstudio.com/" title="NA Design Studio" rel="home">NA Design Studio</a></span></div> <div class="clear"></div> <!-- end #header --></div> <div id="mainContent"><h1 class="typeface-js">Main Content </h1> <div class="typeface-js"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. </p> </div> <!-- end #mainContent --></div> <div id="footer"> <p>na design inc, new york :: all right reserved 2010</p> <!-- end #footer --></div> <!-- end #container --></div> </body> </html> CSS CODE: Code: body { font: 100% Verdana, Arial, Helvetica, sans-serif; background: #FFFFFF; margin: 0; padding: 0; text-align: center; color: #FFFFFF; } .oneColFixCtrHdr #container { width: 800px; background-image: url(images/bg-stripe.png); background-repeat: repeat; margin: 0 auto; border: 1px solid #000000; text-align: left; } .oneColFixCtrHdr #header { padding: 10px 10px 0 10px; background: #000000; } .oneColFixCtrHdr #header h1 { margin: 0; padding: 10px 0; } .oneColFixCtrHdr #mainContent { padding: 0 10px; } .oneColFixCtrHdr #footer { padding: 0 10px; background: #000000; font-family: "Courier New", Courier, monospace; font-style: italic; font-size: 8pt; } .oneColFixCtrHdr #footer p { margin: 0; padding: 10px 0; } .typeface-js { font-family: Haettenschweiler; font-style: italic; letter-spacing: 1px; color: #FFFFFF; } #logo { display: inline; float: right; text-align: left; } #logo a{ background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(images/logo.png); background-origin: initial; background-position: 0 0; background-repeat: no-repeat no-repeat; display: block; height: 118px; margin-bottom: 10px; text-indent: -9000px; width: 296px; } .msie #blog-title a { margin-bottom: -10px; position: relative; } #navigation { background-image: url(images/bg-nav.png); background-position: 0 0; background-repeat: no-repeat no-repeat; float: right; height: 22px; width: 474px; margin-top: 75px; } #navigation ul { } #navigation li { float: right; height: 22px; position: relative; list-style: none; } #navigation li a { font-family: Haettenschweiler; font-style: italic; letter-spacing: 1px; text-decoration: none; text-align: center; color: #FFFFFF; font-size: 0.95em; font-weight: bold; background-image: url(images/bg-nav-btn.png); background-repeat: no-repeat no-repeat; height: 22px; display: block; width: 69px; overflow: auto; } #navigation li a:hover { background-image: url(images/bg-nav-btn.png); background-position: 50% -22px; background-repeat: no-repeat; color: #000000; } #navigation li.item1 a { font-family: Haettenschweiler; font-style: italic; letter-spacing: 1px; text-decoration: none; text-align: center; color: #FFFFFF; font-size: 0.95em; font-weight: bold; background-image: url(images/bg-nav-btn1.png); background-repeat: no-repeat no-repeat; height: 22px; display: block; width: 69px; overflow: auto; } #navigation li.item1 a:hover { background-image: url(images/bg-nav-btn1.png); background-position: 50% -22px; background-repeat: no-repeat; color: #000000; } .clear { height: 0; font-size: 1px; margin: 0; padding: 0; line-height: 0; clear: both; } Example of problem If Image doesnt show below, view it he http://nadesign.pisigmachi.com/wp-content/uploads/2010/02/example.jpg URL HI Guys, I'm trying to create some CSS to contain an image gallery. A query runs which grabs all the images for a certain item/article. I then output the query as a loop, and it populates a div with images. It works pretty good, but if one image is bigger than the others, it throws off the alignment. How can I force each row of photos to be horizontally even? You can see the output results here http://details.at/photo_test.cfm <!--- Query ---> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> <style> #maindiv { padding:0 0 1em 2em; width:550px; float:left; } div.img { margin:3px; height:auto; width:auto; float:left; text-align:center; } </style> </head> <body> <DIV id="maindiv"> <H2>Photos</H2> <CFOUTPUT QUERY="photo_file_info"> <div class="img"> <a href="http://google.com" target=new> <img src="http://details.at/imagehost/classifieds/aircraft/139/s_#photo_file#"> </a> </div> </CFOUTPUT> </DIV> </body> </html> |