CSS - Alternating Columns Help
Help please! I'm trying to apply css to my source to position div elements in alternating columns like this:
stuff1 stuff2 stuff3 stuff4 [etc.] My source looks like this: <div id="container"> <div class="item">stuff1</div> <div class="item">stuff2</div> <div class="item">stuff3</div> <div class="item">stuff4</div> [etc.] </div> I've been able to do this by applying styles like this: #container{ width:250px; } .item{ width:100px; height:100px; margin-right:10px; float:left; display:inline; } But there's a problem. Because all of the elements in #container are floated, the #container div has no height. So any content that's placed after #container in the source overlaps with the items (like the footer I need to add to the page). And unfortunately I cannot add a height to #container because the number of items within it are variable (and so the height is variable). I could apply alternating styles to the item divs and I can add <br/> tags and stuff within the code. I just cannot easily reorder the items in the source. I'd love some help with this. Good karma. Thanks, Bob Similar TutorialsHi, I am trying to alternate 2 images for posts at a forum(in phpbb2) and i've applied the classes but it doesn't seem to take effect Here's the CSS : Code: /* The original RockstarVO Theme for phpBB version 2+ Created by TK Creationz */ /* General page style. The scroll bar colours only visible in IE5.5+ */ body { background-color: #EDE4DB; scrollbar-face-color: #DEE3E7; scrollbar-highlight-color: #FFFFFF; scrollbar-shadow-color: #DEE3E7; scrollbar-3dlight-color: #D1D7DC; scrollbar-arrow-color: #006699; scrollbar-track-color: #EFEFEF; scrollbar-darkshadow-color: #98AAB1; } /* General font families for common tags */ font,th,td,p { font-family: Verdana, Arial, Helvetica, sans-serif; } a:link,a:active,a:visited { color : #0099FF; } a:hover { text-decoration: underline; color : #DD6900; } hr { height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;} /* This is the border line & background colour round the entire page */ .bodyline { background-color: #EDE5DB; border: 1px #98AAB1 solid; } /* This is the outline round the main forum tables */ .forumline { background-color: #F2EFE9; /* border: 2px #006699 solid; */ } /* Main table cell colours and backgrounds */ td.row1 { background-color: #E8E8E8; } td.row2 { background-color: #D8D8D8; } td.row3 { background-color: #E0E0E0; /*#D1D7DC;*/ } /* This is for the table cell above the Topics, Post & Last posts on the index.php page By default this is the fading out gradiated silver background. However, you could replace this with a bitmap specific for each forum */ td.rowpic { background-color: #0099FF; background-image: url(images/Top_middle.jpg); background-repeat: repeat-x; } /* Header cells - the blue gradient backgrounds */ th { color: #000000; font-size: 11pt; font-weight : bold; background-color: #D0D0D0; height: 25px; /* background-image: url(images/Top_middle.jpg); */ } td.cat,td.catHead,td.catSides,td.catLeft,td.catRight,td.catBottom { background-image: url(images/Top_middle.jpg); background-color: #0099FF; background-repeat: repeat-x; } td.catBorder { border-top: solid #0099FF 10px; background: transparent; } td.catBMiddle { background-image: url(images/Bottom_middle.jpg); background-color: #0099FF; background-repeat: repeat-x; } /* Setting additional nice inner borders for the main table cells. The names indicate which sides the border will be on. Don't worry if you don't understand this, just ignore it :-) */ td.cat,td.catHead,td.catBottom { height: 29px; border-width: 0px 0px 0px 0px; } th.thHead,th.thSides,th.thTop,th.thLeft,th.thRight,th.thBottom,th.thCornerL,th.thCornerR { font-weight: bold; background-color: #D0D0D0; height: 28px; } /* the last 3 rows */ td.row3Right,td.spaceRow { background-color: #D1D7DC; border: #FFFFFF; border-style: solid; } th.thHead,td.catHead { font-size: 12px; border-width: 1px 1px 0px 1px; } th.thSides,td.catSides,td.spaceRow { border-width: 0px 1px 0px 1px; } th.thRight,td.catRight,td.row3Right { border-width: 0px 1px 0px 0px; } th.thLeft,td.catLeft { border-width: 0px 0px 0px 1px; } th.thBottom,td.catBottom { border-width: 0px 1px 1px 1px; } th.thTop { border-width: 1px 0px 0px 0px; } th.thCornerL { border-width: 1px 0px 0px 1px; } th.thCornerR { border-width: 1px 1px 0px 0px; } /* Post borders and corners */ td.postVerLCorners { background-image: url("images/Post_left.gif"); background-repeat: repeat-y; background-position: right; padding: 0; } td.postVerRCorners { background-image: url("images/Post_right.gif"); background-repeat: repeat-y; background-position: left; padding: 0; } td.postHorTCorners { background-image: url("images/Post_top.gif"); background-repeat: repeat-x; background-position: bottom; padding: 0; } td.postHorBCorners { background-image: url("images/Post_bottom.gif"); background-repeat: repeat-x; background-position: top; padding: 0; } /* Post table fill color */ td.posttdColor { background-color: #F3EDE5; } th.postthColor { background-color: #F3EDE5; } .postColor { background-color: #F2EFE9; } td.postColorRow1 { background-color: #F2EFE9; background-image: url("images/03.png"); background-position: bottom right; background-repeat: no-repeat; } td.postColorRow2 { background-color: #F2EFE9; background-image: url("images/09.png"); background-position: bottom right; background-repeat: no-repeat; } /* The largest text used in the index page title and toptic title etc. */ .maintitle,h1,h2 { font-weight: bold; font-size: 20px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; line-height : 120%; color : #000000; } /* General text */ .gen { font-size : 12pt; } .genmed { font-size : 10pt; } .gensmall { font-size : 10pt; } .gen,.genmed,.gensmall { color : #585858; } a.gen,a.genmed,a.gensmall { color: #0099FF; text-decoration: none; } a.gen:hover,a.genmed:hover,a.gensmall:hover { color: #00CCFF; text-decoration: underline; } /* The register, login, search etc links at the top of the page */ .mainmenu { font-size : 11px; color : #000000 } a.mainmenu { text-decoration: none; color : #006699; } a.mainmenu:hover{ text-decoration: underline; color : #DD6900; } /* Forum category titles */ .cattitle { font-weight: bold; font-size: 12px ; letter-spacing: 1px; color : #FFFFFF; font-family: Verdana, Arial, Helvetica, sans-serif; } a.cattitle { text-decoration: none; color : #FFFFFF; } a.cattitle:hover{ text-decoration: underline; color: #FF6600; } /* Forum title: Text and link to the forums used in: index.php */ .forumlink { font-weight: bold; font-size: 10pt; color : #0099FF; } a.forumlink { text-decoration: none; color : #006699; } a.forumlink:hover{ text-decoration: underline; color : #43C6DB; } /* Used for the navigation text, (Page 1,2,3 etc) and the navigation bar when in a forum */ .nav { font-weight: bold; font-size: 11px; color : #000000;} a.nav { text-decoration: none; color : #006699; } a.nav:hover { text-decoration: underline; } /* titles for the topics: could specify viewed link colour too */ .topictitle { font-weight: bold; font-size: 11px; color : #000000; } a.topictitle:link { text-decoration: none; color : #006699; } a.topictitle:visited { text-decoration: none; color : #5493B4; } a.topictitle:hover { text-decoration: underline; color : #DD6900; } /* Name of poster in viewmsg.php and viewtopic.php and other places */ .name { font-size : 11px; color : #000000;} /* Location, number of posts, post date etc */ .postdetails { font-size : 10px; color : #000000; } /* The content of the posts (body of text) */ .postbody { font-size : 12px;} a.postlink:link { text-decoration: none; color : #006699 } a.postlink:visited { text-decoration: none; color : #5493B4; } a.postlink:hover { text-decoration: underline; color : #DD6900} /* Quote & Code blocks */ .code { font-family: Arial, Courier, 'Courier New', sans-serif; font-size: 11px; color: #006600; background-color: #FAFAFA; border: #D1D7DC; border-style: solid; border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px } .quote { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #444444; line-height: 125%; background-color: #FAFAFA; border: #D1D7DC; border-style: solid; border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px } /* Copyright and bottom info */ .copyright { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} a.copyright { color: #444444; text-decoration: none;} a.copyright:hover { color: #000000; text-decoration: underline;} /* Form elements */ input,textarea, select { color : #000000; font: normal 11px Verdana, Arial, Helvetica, sans-serif; border-color : #000000; } /* The text input fields background colour */ input.post, textarea.post, select { background-color : #FFFFFF; } input { text-indent : 2px; } /* The buttons used for bbCode styling in message post */ input.button { background-color : #EFEFEF; color : #000000; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; } /* The main submit button option */ input.mainoption { background-color : #FAFAFA; font-weight : bold; } /* None-bold submit button */ input.liteoption { background-color : #FAFAFA; font-weight : normal; } /* This is the line in the posting page which shows the rollover help line. This is actually a text box, but if set to be the same colour as the background no one will know ;) */ .helpline { background-color: #DEE3E7; border-style: none; } /* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */ @import url("formIE.css"); Here's the view_topic_body.tpl code : PHP Code: <link href="Rockstar02.css" rel="stylesheet" type="text/css" /> <table width="100%" cellspacing="2" cellpadding="2" border="0"> <tr> <td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><br /> <span class="gensmall"><b>{PAGINATION}</b><br /> </span></td> </tr> </table> <table width="100%" cellspacing="2" cellpadding="2" border="0"> <tr> <td align="left" valign="middle" width="43%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td> <td width="8%" align="right" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a> <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td> </tr> <tr> <td align="right" valign="middle" width="100%" colspan="2"><span class="nav"><a href="{U_VIEW_OLDER_TOPIC}" class="nav">{L_VIEW_PREVIOUS_TOPIC}</a> :: <a href="{U_VIEW_NEWER_TOPIC}" class="nav">{L_VIEW_NEXT_TOPIC}</a> </span></td> </tr> </table> <table width="145%" cellspacing="0" cellpadding="0" border="0"> <tr align="right"> <td class="catHead" width="20" align="left" valign="top"><img src="templates/myfs_trupti2/images/Top_blueLeft.jpg" width="11" height="44" /></td> <td height="44" colspan="2" align="left" valign="middle" class="catHead"> <a class="cattitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></td> <td class="catHead" height="44" align="left" valign="top"><img src="templates/myfs_trupti2/images/Top_blueRight.jpg" width="20" height="44" align="right" valign="top" /></td> </tr> <tr align="right"> <td height="20" colspan="4" align="left" valign="top" style="background: transparent;"> </td> </tr> {POLL_DISPLAY} <!-- BEGIN postrow --> <tr> <td class="postVerLCorners" nowrap="nowrap" width="20" align="right" valign="bottom"><img src="templates/myfs_trupti2/images/Post_TopLeftCorner.jpg" width="20" height="20" align="right" valign="bottom" /></td> <td class="postHorTCorners" nowrap="nowrap" height="20" width="150" align="right" valign="bottom"></td> <td height="20" colspan="1" nowrap="nowrap" class="postHorTCorners"> </td> <td nowrap="nowrap" width="20" height="20" align="left" valign="bottom"><img src="templates/myfs_trupti2/images/Post_TopRightCorner.jpg" width="20" height="20" align="left" valign="bottom" /> </td> </td> </tr> <tr> <td width="20" class="postVerLCorners"> </td> <td class="posttdColor" width="150" height="200" align="left" valign="top"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td> <td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="posttdColor" width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> <td class="posttdColor" valign="top" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td> </tr> <tr> <td class="posttdColor" colspan="2"><hr /></td> </tr> <tr> <td class="{postrow.ROW_CLASS}" height="200" align="left" valign="top" colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td> </tr> </table></td> <td class="postVerRCorners" width="20"> </td> </tr> <tr> <td class="postVerLCorners" width="20"> </td> <td class="posttdColor" width="150" align="left" valign="middle"><span class="nav"><a href="#top" class="nav">{L_BACK_TO_TOP}</a></span></td> <td class="posttdColor" width="100%" height="28" valign="bottom" nowrap="nowrap"><table cellspacing="0" cellpadding="0" border="0" height="18" width="18"> <tr> <td class="posttdColor" valign="middle" nowrap="nowrap">{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}<script language="JavaScript" type="text/javascript"><!-- if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 && navigator.userAgent.indexOf('6.') == -1 ) document.write(' {postrow.ICQ_IMG}'); else document.write('</td><td class="posttdColor"> </td><td class="posttdColor" valign="top" nowrap="nowrap"><div style="position:relative"><div style="position:absolute">{postrow.ICQ_IMG}</div><div style="position:absolute;left:3px;top:-1px">{postrow.ICQ_STATUS_IMG}</div></div>'); //--></script><noscript>{postrow.ICQ_IMG}</noscript></td> </tr> </table></td> <td class="postVerRCorners" nowrap="nowrap" width="20"> </td> </tr> <tr> <td class="postVerLCorners" width="20" height="20" align="right" valign="top"><img src="templates/myfs_trupti2/images/Post_BottomLeftCorner.jpg" width="20" height="20" align="right" valign="top" /></td> <td class="postHorBCorners" align="left" valign="middle"> </td> <td class="postHorBCorners" height="20" valign="bottom" nowrap="nowrap"> </td> <td class="postVerRCorners" nowrap="nowrap"><img src="templates/myfs_trupti2/images/Post_BottomRightCorner.jpg" width="20" height="20" align="left" valign="top" /></td> </tr> <tr> <td colspan="4" height="10" border="10"> </td> </tr> <!-- END postrow --> <tr align="center"> <td class="catBottom" colspan="4" height="28"><table cellspacing="0" cellpadding="0" border="0"> <tr><form method="post" action="{S_POST_DAYS_ACTION}"> <td align="center"><span class="gensmall">{L_DISPLAY_POSTS}: {S_SELECT_POST_DAYS} {S_SELECT_POST_ORDER} <input type="submit" value="{L_GO}" class="liteoption" name="submit" /></span></td> </form></tr> </table></td> </tr> </table> <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> <td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a> <a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td> <td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td> <td align="right" valign="top" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span> </td> </tr> <tr> <td align="left" colspan="3"><span class="nav">{PAGE_NUMBER}</span></td> </tr> </table> <table width="100%" cellspacing="2" border="0" align="center"> <tr> <td width="40%" valign="top" nowrap="nowrap" align="left"><span class="gensmall">{S_WATCH_TOPIC}</span><br /> <br /> {S_TOPIC_ADMIN}</td> <td align="right" valign="top" nowrap="nowrap">{JUMPBOX}<span class="gensmall">{S_AUTH_LIST}</span></td> </tr> </table> Here's the link to my forum : My Forum P.S: when i refresh the topic page on the site and 'View Source' it does show that the classes(postColorRow1 & postColorRow2) set for the background image change are alternating, but CSS does not take effect. Please help. I see that CSS3 will finally have support for this, but I thought I'd stumbled upon support in CSS1 or CSS2(.1) also. I even printed it out, though I can't find it now. Does anyone know how to alternate row colors in CSS2.1 without resorting to tr.row1 and tr.row2 or scripting? Hello, I'm working now on div layout that contains 3 sections (header, body, footer) in one centered wrapper with border (divs with background imgs). My problem is: - divs that are in fact borders (id="l_outerborder_b" and id="r_outerborder_b") don't stretch when main container (id="body_content_text") grows. Here is a html code: Code: <!--BEGIN TEMPLATE HEADER --> <!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> <link href="template.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="template.js" /> </head> <body onload="onloadprocedures()"> <div id="main_container"> <div id="template_header"> <div id="tl_outerborder"></div> <div id="t_outerborder"></div> <div id="tr_outerborder"></div> <div id="l_outerborder_h"></div> <div id="header_content"> <div id="logo"><img src="img/logo.png" alt="" /></div> <div id="slogan"><img src="img/slogan.png" alt="Centrum zdrowia" /></div> </div> <div id="r_outerborder_h"></div> </div> <!-- END TEMPLATE HEADER --> <!-- BEGIN TEMPLATE BODY --> <div id="template_body"> <div id="l_outerborder_b"></div> <div id="body_content"> <div id="body_content_text"> <p>TEST</p> </div> </div> <div id="r_outerborder_b"></div> </div> <!-- END TEMPLATE BODY --> <!-- BEGIN TEMPLATE FOOTER --> <div id="template_footer"> <div style="clear:both"></div> <div id="l_outerborder_f"></div> <div id="footer_content"></div> <div id="l_outerborder_f"></div> <div id="bl_outerborder"></div> <div id="b_outerborder"></div> <div id="br_outerborder"></div> </div> </div> </body> </html> <!-- END TEMPLATE FOOTER --> and CSS: Code: @charset "utf-8"; /* CSS Document */ body { background-color:#FFFFFF; font-family:Tahoma, Verdana, "Times New Roman", Arial; font-size:12px; } a:link {text-decoration: none} /* unvisited link */ a:visited {text-decoration: none} /* visited link */ a:hover {text-decoration: none} /* mouse over link */ a:active {text-decoration: none} /* selected link */ #main_container { position:relative; margin:auto; width:960px; height:auto; } #template_header { float:left; position:relative; width:960px; height:300px; } #header_content { float:left; position:relative; width:900px; height:270px; } #logo { width:310px; height:130px; position:relative; float:left; top:0px; left:0px; } #slogan { width:580px; height:100px; position:relative; float:left; top:0px; left:0px; } #tl_outerborder { float:left; position:relative; background-image:url(img/tl_outerborder.png); width:30px; height:30px; } #t_outerborder { float:left; position:relative; background-image:url(img/t_outerborder.png); width:900px; height:30px; } #tr_outerborder { float:left; position:relative; background-image:url(img/tr_outerborder.png); width:30px; height:30px; } #l_outerborder_h { float:left; position:relative; background-image:url(img/l_outerborder.png); background-repeat:repeat-y; width:30px; height:270px; } #r_outerborder_h { float:right; position:relative; background-image:url(img/r_outerborder.png); background-repeat:repeat-y; width:30px; height:270px; } #body_content { float:left; position:relative; width:900px; overflow:hidden; } #body_content_text { float:left; position:relative; width:600px; margin: auto; overflow:hidden; } #l_outerborder_b { float:left; position:relative; background-image:url(img/l_outerborder.png); background-repeat:repeat-y; width:30px; height:inherit; } #r_outerborder_b { float:right; position:relative; background-image:url(img/r_outerborder.png); background-repeat:repeat-y; width:30px; height:inherit; } #l_outerborder_f { float:left; position:relative; background-image:url(img/l_outerborder.png); background-repeat:repeat-y; width:30px; height:inherit; } #r_outerborder_f { float:right; position:relative; background-image:url(img/r_outerborder.png); background-repeat:repeat-y; width:30px; height:inherit; } #template_body { float:left; position:relative; width:960px; overflow:hidden; } #bl_outerborder { float:left; position:relative; background-image:url(img/bl_outerborder.png); width:30px; height:30px; } #b_outerborder { float:left; position:relative; background-image:url(img/b_outerborder.png); width:900px; height:30px; } #br_outerborder { float:left; position:relative; background-image:url(img/br_outerborder.png); width:30px; height:30px; } Thanks in advance for info how to stretch those doomed divs EDIT: Here is layout concept. URL hTTp://qsrc.pl/layout.jpg Hi, I am looking to retrieve content from a database (that part I can handle) and then output it to the browser, but my css is poor. I want to create a two column format, which I am ok with using two div's in using absolute positioning in a relative frame, but that doesn't allow content to flow. I am looking for text that flows from the fixed bottom of the first column to the top of the second. If there is a way to do this, or anyone can point me to any resources, I'd appreciate it. Thanks Have a little problem with the 3-column layout. I'm converting it down to 2-column, which should be easier. However, in all exampels I've seen, there is no need to assign height, and all of the column divs always stay the same height. I can't seem to duplicate this. Here's what I have: PHP Code: <div id="leftCol"> <p>crap</p> <p>crap</p> <p>crap</p> <p>crap</p> <p>crap</p> </div> <div style="width: 200px;"> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> <p>more content</p> </div> <div class="clear"> </div> and the relevant CSS: PHP Code: .clear{ /* clearing element for floats */ font-size: 0px; /* for weird IE */ height: 0px; width: 0px; clear: both; } div{ margin: 0px; padding: 0px; border: 0px black solid; } #leftCol{ width: 100px; border: 5px #000077 solid; border-top: 0px #000077 solid; margin: 0px; padding: 0px; float: left; } * html #leftcol{ /* Tan Box Hack */ width: 104px; width: 100px; } IE likes it (IE likes just about anything), but the "more content" text gets wrapped around the "leftCol" in Firefox. Any suggestions to what I'm missing? Thanks! I'm building a CSS web site and the main body of the page has a left column containg navigation and then the content on the right. What I want to have is that the height of the smallest of the 2 columns to equal that of the the highest, currently the navigation either runs over the borders of the actual box, or the text from the right column undercuts the navigation column. To see what I mean see www.twstd.net/future/. Hoiw can I prevent the above display issues? Thanks. Notice on NZBMatrix.com on the left hand side, it looks as if there were multiple boxes where normally just one navigation box would exist in a three-column layout. I already know how to do a three-column layout, but my question is, are there several different columns on the left of this website, or is it just one column with several sections defined by borders? Thank you for any advice. Hi, i tried to change this blogger theme from 2 to 3 columns... but when done .... the menu bar on sidebar disapear... Can you help me?... for you I don't think is so difficult; I'm not a web designer but a system administrator... so, is not so easy. This is the link where you can find the xml. plantillasblogyweb.googlepages.com/Blogy-iPlantilla-Blogyweb.blogspot.c.xml Thank you in advance Surfparadise The columns work, however underneath the selected item, a gap forms. But only on the first 2/3 columns. Why? How can i stop it? Sorry about the messiness of the HTML code, it is dynamically created so readability in source code of page was not thought about! Sometimes you will be able to see it on my testing server. Screenshots for when my server is not online are attached. CSS: css Code: Original - css Code #listview { position:absolute; top:122px; left:273px; border:solid 2px #000; height:412px; width:694px; padding-top:15px; overflow:scroll; } #listview li { background-position:left center; background-repeat:no-repeat; border-left:1px solid #000; border-right:1px solud #000; float:left; height:80px; width:150px; overflow:hidden; margin:10px; text-align:center; }
HTML: html4strict Code: Original - html4strict Code <div id="listview"><ul id="listview_ul"><li class="selected" style="background-image: url(.images/ext/txt.gif);" id="40b65fa114057838a74dc7a4b630c36a" onclick="javascript:getDetails(this,'FRED? IT WORKS! Yes? apart from really big file names such as this one which stop the rename box being visible!.txt')">FRED? IT WORKS! Yes? apart from really big file names such as this one which stop the rename box being visible!.txt <input id="FRED? IT WORKS! Yes? apart from really big file names such as this one which stop the rename box being visible!.txt" value="FRED? IT WORKS! Yes? apart from really big file names such as this one which stop the rename box being visible!.txt" name="rname_name" style="display: none;" type="text"> <input name="rname_folder" value="/FRED? IT WORKS! Yes? apart from really big file names such as this one which stop the rename box being visible!.txt" type="hidden"> <input name="rname_button" value="Rename" style="display: none;" onclick="javascript:rname_save();" type="button"> </li><li class="" style="background-image: url(.images/ext/txt.gif);" id="777468c20ef558d02fac83c104f69389" onclick="javascript:getDetails(this,'U GOT TOLD!.txt')">U GOT TOLD!.txt <input id="U GOT TOLD!.txt" value="U GOT TOLD!.txt" name="rname_name" style="display: none;" type="text"> <input name="rname_folder" value="/U GOT TOLD!.txt" type="hidden"> <input name="rname_button" value="Rename" style="display: none;" onclick="javascript:rname_save();" type="button"> </li><li class="" style="background-image: url(.images/ext/genericBlue.gif);" id="9eee28d877a7f1616a57e8a52165d99a" onclick="javascript:getDetails(this,'U GOT TOLD.txt111')">U GOT TOLD.txt111 <input id="U GOT TOLD.txt111" value="U GOT TOLD.txt111" name="rname_name" style="display: none;" type="text"> <input name="rname_folder" value="/U GOT TOLD.txt111" type="hidden"> <input name="rname_button" value="Rename" style="display: none;" onclick="javascript:rname_save();" type="button"> </li><li class="" style="background-image: url(.images/ext/txt.gif);" id="5dd99cc991e032ee43afd619fa300157" onclick="javascript:getDetails(this,'You get a message if you dont put any content. Solved now.txt')">You get a message if you dont put any content. Solved now.txt <input id="You get a message if you dont put any content. Solved now.txt" value="You get a message if you dont put any content. Solved now.txt" name="rname_name" style="display: none;" type="text"> <input name="rname_folder" value="/You get a message if you dont put any content. Solved now.txt" type="hidden"> <input name="rname_button" value="Rename" style="display: none;" onclick="javascript:rname_save();" type="button"> </li><li style="background-image: url(.images/ext/txt.gif);" id="a120c2992faa1a664a87378674340f0c" onclick="javascript:getDetails(this,'hahahah.txt')">hahahah.txt <input id="hahahah.txt" value="hahahah.txt" name="rname_name" style="display: none;" type="text"> <input name="rname_folder" value="/hahahah.txt" type="hidden"> <input name="rname_button" value="Rename" style="display: none;" onclick="javascript:rname_save();" type="button"> </li><li style="background-image: url(.images/ext/php.gif);" id="828e0013b8f3bc1bb22b4f57172b019d" onclick="javascript:getDetails(this,'index.php')">index.php <input id="index.php" value="index.php" name="rname_name" style="display: none;" type="text"> <input name="rname_folder" value="/index.php" type="hidden"> <input name="rname_button" value="Rename" style="display: none;" onclick="javascript:rname_save();" type="button"> </li><li style="background-image: url(.images/ext/txt.gif);" id="e4c275a9e3ae1a0ac717c02826694d61" onclick="javascript:getDetails(this,'it works.txt')">it works.txt <input id="it works.txt" value="it works.txt" name="rname_name" style="display: none;" type="text"> <input name="rname_folder" value="/it works.txt" type="hidden"> <input name="rname_button" value="Rename" style="display: none;" onclick="javascript:rname_save();" type="button"> </li><li style="background-image: url(.images/ext/txt.gif);" id="872002aaa5df50c813fd3443dc0bf561" onclick="javascript:getDetails(this,'lol.txt')">lol.txt <input id="lol.txt" value="lol.txt" name="rname_name" style="display: none;" type="text"> <input name="rname_folder" value="/lol.txt" type="hidden"> <input name="rname_button" value="Rename" style="display: none;" onclick="javascript:rname_save();" type="button"> </li><li style="background-image: url(.images/ext/exe.gif);" id="aeee850280b2d24f213678fe7ca9bc0b" onclick="javascript:getDetails(this,'look at da preety icons.exe')">look at da preety icons.exe <input id="look at da preety icons.exe" value="look at da preety icons.exe" name="rname_name" style="display: none;" type="text"> <input name="rname_folder" value="/look at da preety icons.exe" type="hidden"> <input name="rname_button" value="Rename" style="display: none;" onclick="javascript:rname_save();" type="button"> </li></ul></div>
I am trying to create a page with two side by side boxes, each coloured differently, and a third box, the full width of the page, directly underneath the other 2. The puzzling thing for me is that when I define the two side by side boxes as 50% each the left box will appear under the bottom box. If I define 1 of the boxes as 49.9% they appear side by side with a small strip between them. The other thing is that although I have defined margin and padding as 0 the boxes do not fill the width of the screen. Can anybody explain to me how to get the screen filled to 100% and the 2 columns to take 50% of the screen each. Here is the code: Code: .main_container{ margin:0; padding:0; width: 100%; height: 400px; //change to whatever size you wish background-color:#FFF; } .left_box{ margin:0; padding:0; width: 50%; height: 400px; //change to whatever size you wish clear: left; float: left; background-color:#333; } .right_box{ margin:0; padding:0; width: 50%; height: 400px; //change to whatever size you wish clear: right; float: right; background-color:#666; } .footer{ margin:0; padding:0; width: 100%; height: 100px; //change to whatever size you wish clear: both; position:relative; background-color:#888; } Just wondering is it a good way to do columns in css using two spans set to float left and then right and having their widths set, then the content in divs or spans inside them? Hi, im kind of new to css and im trying to find the most effective way to organize content into 4 columns, I need the columns to be fixed of about 175px, is it possible to use list for this? Never Mind, I got it, I just discovered what "clear:" does Hi I am new to css and am trying to use the following code to make a page. i cant seem to position the content on the right of the left nav. i want it so that the content div resizes and stays in the same position when the browser is resized but the leftnav stays in the same position and doesnt re size....any help would be appreciated. third.css body { /*sets properties for the body of the document*/ background-color:#ffffff; margin:0px 0px 0px 0px; } #container { margin-top: 50px; margin-left: 50px; margin-right: 50px; margin-bottom: 50px; padding: 0px; background-color: orange; width: 80%; min-width: 181px; } #footer { padding: 0px; position: relative; padding: 0px; background-color: yellow; width: 100%; } #content { left:200px; width:100%; background-color: red; } #leftnav { /*sets properties for the left nav bar*/ background-color : #66ccff; width: 180px; } third.html <div id="container"> container <div id="leftnav">left nav</div> <div id="content">content content content content content content content content content content content content content content content content content content </div> <div id="footer">footer</div> </div> http://jordanmeeter.com/?page=about How would I make it so the left and right columns increase in height as the content gets taller and taller? Thanks. :-) Hi, I am trying to setup 2 columns in XHTML, and am wondering how I would get the right column to automatically begin after the left column. PHP Code: <div id="container"> <div id="leftcolumn"> <div id="leftcolumntop"> aaaa </div> <div id="leftcolumnbottom"> bbb </div> </div> <div id="rightcolumn"> <div id="rightcolumntop"> ccc </div> <div id="rightcolumnbottom"> ddd </div> </div> </div> So basically what I'm looking to do is position "rightcolumn" so it begins right after "leftcolumn". I'm not sure how to tho. Right now I'm using absolute positioning, but I'd rather have it all line up automatically rather then having to play with #'s to get it to line up every time. Hello, I am looking for a CSS two fixed width columns centered layout with header and footer. Could someone recommend me a good one? Thank You, Miguel Hi, there. I've created a simple tableless 3-column fixed-width layout within a 'wrapper' div#. The column displays exactly how I want it and where I want it in Firefox, Safari, Chrome... but not in IE7 - for some reason, IE7 repeats part of the content of the third column. courses.algarve-golf.co.uk/index.html courses.algarve-golf.co.uk/scripts/default.css (The site isn't yet finished, so while the CSS validates, the HTML is not completely validated as I have more content, nav-bars and so on to add.) I've double and triple-checked everything I know of, but as my CSS experience is somewhat limited, I'm hopeful that this is just the result of a known IE7 that i'm not yet aware of. Any help or advice that anyone can offer greatfully appreciated! Hi So I am setting up a portfolio website and I have been focusing mainly on the highslide portion which I got working great (with this forums help, thank you!). Now I have gotten rid of all the tables and garbage like that and am trying to make the images the backgrounds so they will be locked but now the image links spill out of the column and don't line up anymore. this is what it SHOULD look like: http://kdpatton.com/index01.htm but this is what does look like: http://kdpatton.com/portfolio02.htm I can't figure out why. Any help would be great. Love this forum! Hi all, I have the following: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <style type="text/css"> <!-- body, html{ height:100%; text-align:center; margin:0px; padding:0px; } #main,#header,#footer,#cleaner{ margin-left:auto; margin-right:auto; width:750px; text-align:left; } #main{ /*this height is for ie only*/ height:100%; min-height:100%; margin-bottom:-50px; } /*ie wont see this, other browsers will*/ body>div#main{ height: auto; } #header, #footer,#cleaner{ height:50px; } --> </style> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <? include ('include/head.php'); ?> </head> <body> <div id="main"> <div id="header"> <? include ('include/top_nav.php'); ?> </div> <? include ('return_policy.php'); ?> <div id="cleaner"></div> </div> <div id="footer"> <? include ('include/footer.php'); ?> </div> </body> </html> It appears to have two columns either side but i can't add anything to them. Can anyone tell me how i might be to add a background image? Cheers, camcim |