CSS - Floating News
I have a page with content on the left and a menu with "latest" news sitting directly under it. When the pages get longer, when you scroll down there is whitespace there. So I want the "latest news" section to follow the page, however, when I set the position to fixed the news overlaps the menu.. only to be made worse by the fact that I use jquery's accordion plug-in.
I'm a new member so I can't directly post a link..but freezerburned dot org /tikigaq.com/old.php I'm out of ideas. Thanks for the help. Similar TutorialsHi Guys, Thanks to some incredible pointing me in the right direction yesterday, i have finally got to my 3-col layout that I want. The only issue is now my news box will let content role behind it, but really i want it to push down as with the footer bar! Can anyone point me in the right direction please? Stylesheet below and output at www.generating-sets.com/index.new2.php PHP Code: html {height:100%;} body { margin:0; padding:0; height:100%; background-image:url(bgs.gif); background-position:top right; background-repeat:repeat-y; background-color:#ffffff; font-family: Times, "Times New Roman", serif; } #wrap { background-image:url(bg.gif); background-position:top left; background-repeat:repeat-y; min-height:100%; } * html #wrap {height:100%} #header { background-image:url(label2.gif); background-position:right; background-repeat:no-repeat; background-color: #000066; border-bottom: 2px #ffffff solid; color: #ffffff; margin:0; padding:0; height:80px; } p {margin:5px; padding:0;} h1 { position:relative; line-height:80px; margin:0; padding-left:20px; } #left { float:left; width:150px; color: #ffffff; text-align:center; background-color: #000066; } #main { position:relative; margin-left:200px; } #right { float:right; width:10px; text-align:center; color: #ffffff; background-color: #000066; } #content { padding:5px; margin-right:200px; text-align:left; } #clearfooter { clear:both; height:80px; overflow:hidden; } #footer { height:40px; background-color: #000066; border-top: 2px #ffffff solid; margin:0; padding:0; margin-top:-0px; color: #ffffff; text-align:center; } div#newsbar {padding: 1%; text-align: center; height:150px; background-color: #000066; color: #ffffff; margin-left: +150px; margin-right: +10px; margin-top: -190px; border: 2px #ffffff solid; width: auto;} code { font-size:0.8em; border:1px solid navy; background-color:white; color:#333333; padding:10px; display:block; width:80%; margin:10px auto; overflow:auto; } There must be a reason why it works like it does, but i don't know!! Charlie OK well I figured that instead of spamming the forums I would post my two problems here. First problem: www.djoj.net/home.html www.djoj.net/style.css I am trying to replace my Tables with Div's... but when I do they overlap. Is there something I am missing? The margin property is not spacing them out according to eachother... um... wait... OK nvm, I just thought of the problem... position: relative; (I think) NEXT (left that there in case someone decides to search the forum) www.djoj.net/home.html www.djoj.net/style.css I have a hip-hop news script which loads the news from rapbasement.com Unfortunatly, in Firefox the headlines are being effected by my CSS somehow... this normally wouldent be a problem but it is making the text larger and it is making everything out of line. Help? Thank you. I am trying to set up my post using a wordpress template I found on alexking.org called Blue Radiant. All was going well until I decided to make a few test news posts and it started doing something funky. http://www.unlimitedzelda.net If you view the site in Internet Explorer, it's fine. However if you view it in FireFox, you can see that all but the most current news post gets pushed under the left nav bar. I can't figure why and I hope someone else will be able to help me out. Any input is greatly appreciated. I'm creating a website in html/css, and I hope this is the correct forum for this issue. I'm not expecting anyone to explain exactly how to do this, but maybe just a point in the right direction as I haven't been able to search for this correctly. Essentially I currently have a list of news items on the front page of my site. I want there to be a small indicator beneath each of these news items that says "comments (#)" where # is number of user comments about that news item. If this is clicked it would take the reader to a different page with the full news article and below it a list of the comments. It seems like some kind of wordpress implementation might work here but I have no idea where to look for something like this. Sorry if that was a little hard to understand, but I can't post urls yet to help explain. Thanks in advance! I currently have the following layout Code: <table> <tr> <td></td> <td></td> </tr> </table> how do i go about making the same layout but using CSS. Each <td> is 50% wide hi, i am a total newbie with css and trying to create a floating divider. an example can be seen at www.payjunction.com. does anyone know a tutorial on how to create one? thanks for the help in advance Learning CSS and trying to emulate the following table: Code: |--------------------------------------| | Text 1 |----------------| | | Text 2 | Inner box text| | | Text 3 |----------------| | |--------------------------------------| I can get a nested div to work vertically but not horizontally. I'm trying: Code: div#container { float: left } div#title { float: right } <div id="container"> hello<br>hello <div id="title"> Text 1<br /> Text 2 </div> </div> Which is producing: Code: |--------------------------------------| | Hello | | Hello | | |----------------| | | | Text 1 | | | | Text 2 | | | |----------------| | |--------------------------------------| Perhaps a positioning thing which I don't understand yet? It's not homework so you don't have to do it for me, but rather you could just point to knowledge sources.... Tx! Hi, Can someone help me with why the following header bar doesn't work in Firefox? It just shows the very top of the bar with the two other divs inside of it. Code: <div class="cmsHeader"> <div style="float: left;">Page Name</div> <div style="float: right;"><a href="" title='Add Page'><img src='images/icons/file_(add)_16x16.gif' border='0' alt='Add Page'></a></div> </div> .cmsHeader{ background: #809096; padding: 5px; width: 98%; color: #FFFFFF; } .cmsHeader a{ color: #FFFFFF; text-decoration: none; } .cmsHeader a:hover{ text-decoration: underline; } I have 3 tables in a div. I have two of the tables one on top of the other. I wanted to place the third table to the left of the bottom table. So I placed the second table relative and left -50px. I placed the third with position absolute, top -70px and float right to achieve this layout. Is there a better way of doing this out of curiousity? Hi Everyone, I've been doing modest CSS for a while now and feel like I have a good grasp of it, and generally find a way of doing what I want. But, this has always bugged me and I need to understand what is going on... I think it's a question of Floating. This is in reference to http://www.arabellamusic.co.uk I want the blog posts to be on the left, and some other content on the right. How is the best way to go about doing this? You can check my source, but this was my thinking: Code: HTML <div class='inner'> <div class='left'> BLOG PHP HERE </div> <div class='right'> SOME OTHER STUFF HERE </div> </div> And the CSS: .inner { width:788px; } .left { float:left; width:50%; } .right { float:left; width:50%; } If you grab my stylesheet and my source, you will see that I have a couple more things in there, but I don't think they could be affecting the rest (text-align etc...) So, am I doing this wrong? I have floated columns in other websites this way and it sometimes works, sometimes doesn't. Incidentally, once it would only work when I set 49% to each, I was assuming this was something to do with the box model I read about, but wasn't too sure. I will try not to play around with the site too much until I get a reply or two, but a few things may jump around as I try stuff! Thanks in advance... James Hi again could someone help me figure out why my left and right box's on thid design are not inline with the content (middle) box thanks see attached pic to see what i mean. Code: CSS CODE body { background:#ffffff; color:#000000; font:76% Verdana,Tahoma,Arial,sans-serif; margin:0; padding:0; text-align:center; } /*** Main container ***/ #container { background:#EAEAEA url() repeat-x; color:#000000; width:90%; margin:5px; min-width:770px; padding:0; } /*** Content ***/ #content { background-color:#EEEEEE; border:1px solid #DEDEDE; color:#000000; padding:15px 20px 5px; height:500px; margin:5px; } /*** Main Banner ***/ #Banner { background-color:#EEEEEE; height:55px; border:1px solid #DEDEDE; padding:15px 20px 5px; margin:5px; } /*** Left Side Navigation ***/ #SideNav { width:15%; float:left; background-color:#EEEEEE; border:1px solid #DEDEDE; color:#000000; min-width:200px; padding:15px 20px 5px; margin:3px; } /*** Right Side content ***/ #RightCon { float:right; width:15%; background-color:#EEEEEE; border:1px solid #DEDEDE; color:#000000; padding:15px 20px 5px; min-width:200px; margin:3px; } Thanks Hello. I spoke with some css developers yesterday on IRC but they failed to fix the problem. They suggested me to ask here for help so I will. I am currently making a new homepage and this is my page; mg-s.org/newly/ I had to edit most of the .css because the page was "floating". Like, some people couldn't see everything and if we zoomed in or out then the page got messed up.. So here is the current progress: mg-s.org/newly/ which is messed up. It's supposed to look like this: pokit.org/get/?00e5090c7ab5a0972f325bb16608f6fb.jpg But as you can see it's not. Here is the style.css : pastebin.com/BPrfZuBd Here is the index.php : pastebin.com/BDQKcxCE I am not that familiar with css so I need help. I've already editing on the size in the .css like on "top" to fix the #panel so it goes futher up but it's not working. Same with the #rightmenu I have a 4 column div layout using floats. When I resize the browser the text in the columns goes outside of the div, and over everything below it. Is there any way to insure that as the browser is resized the text will stay inside it's div? Here's an example of my code: CSS: Code: div#middle { line-height: 130%; text-align: left; margin-left: auto; margin-right: auto; min-width: 800px; } div#featured { background-color: #666; color: #333; border-right: 1px solid gray; width: 30%; float: left; padding: 1em; font-size: 14px; } div#snippets { background-color: #444; color: #333; width: 20%; float: left; padding: 2em; font-size: 12px; } div#tools { color: #333; background-color: grey; width: 150px; float: left; padding: 1em; } div#ads { background-color: #444; color: #333; width: 100px; float: left; padding: 1em; } HTML: Code: <div id="middle" class="minmax"> <!-- Main Articles --> <div id="featured" class="vsize"> <h1>Featured Header</h1> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p> </div> <!-- Short Articles --> <div id="snippets" class="vsize"> <h1>Snippets Header</h1> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p> </div> <!-- Search, other tools, event calendar --> <div id="tools" class="vsize">Tools</div> <!-- Ads --> <div id="ads" class="vsize">Ads</div> </div> Hi I use DIV to display image thumbnails in a row from php loop. for each div containing image I have set the attribute float: left; so that multiple images can be displayed in parallel. Now the problem is that if I have a single image then there is no need to show it on the extreme left of the page but in the center, but the thumbnail is displayed on the extreme left, here is my code till now, PHP Code: echo "<div style=' text-align: center; border: solid 1px #993333; padding: 1px; margin: 2px; float: left; margin-left: 6%; '>"; echo "<div style=' text-align: center; padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px;'> <a href='/$path' rel=\"lightbox\"><img src='/print_resize_image.php?image=$path&type=$extension' width=200 height=150 border=0 ></a> </div></div>"; I've got a really weird situation happening in IE7, and I can't figure out what I could possibly be doing wrong. I've got two divs on a page - one floating left, the other right. Each div contains two fieldsets, none of which are floated. This is the general setup: HTML Code: <div id="colRight"> <fieldset id="serviceArea"> ... </fieldset> <fieldset id="defineArea"> ... </fieldset> </div> <div id="colLeft"> <fieldset id="profile"> ... </fieldset> <fieldset id="profileBio"> ... </fieldset> </div> CSS Code: #colLeft { float:left; margin-right:15px; } #colRight { float:right; } fieldset { padding:0 1em 1em 1em; margin-bottom:1em; } fieldset#defineArea, fieldset#serviceArea { float:none; width:230px; padding:0 10px 10px 10px; } Everything lines up perfectly in IE8, FF3.6 and Chrome, but in IE7 (actually, IE8 in Compatibility Mode) #serviceArea floats to the left of #defineArea (or vice-versa) in #colRight, and #colLeft gets pushed down below the now-too-wide #colRight. Since fieldsets are block-level elements, how can they be floating, especially when I explicitly set them to float:none? There's a stripped-down version of the page at http://www.weddingpastorsusa.org/design2/test_editform.html. Any help would be greatly appreciated. http://jordanmeeter.com/new/links.php If you view that page in Firefox, it displays how it is supposed to. But if you view the page in Internet Explorer, you can see that it is severely ****ed up! Any suggestions? Thanks, Jordan Gah. Internet Explorer is doing mighty funky things with my webpage. http://www.maths.tcd.ie/~icecube The floating images in the main posts work fine from firefox, but in the IE that I checked them out on, there are just blank spaces where the images/comments/bored should be - but even then you can still right click on the space where the image should be to save it and stuff. Anyone have any help/suggestions? I have a web page in which I have a table and within that table I have a sub table with two columns. I am using css and allow visitors to move the first column from right to left (they both are different sizes). I now have a need the text in column one be wrapped under column two (as you can do with pictures in say MS word). I can't write the text ahead of time at the bottom of column two as that column floats from left to right -- meaning that the text that should go underneath would be different each time. I assume it is not possible with tables to do such a thing, but thought to ask the experts to see if it is possible or there is another logical way of accomplishing it. I could simply call two different files based on the right-float and left-float and right text accordingly in both files, but to me that does not sound such a great idea. http://tonglebeak.com View it in FF, and the floating boxes correctly appear on top of the white div underneath of it. View it in IE, and the floating boxes push the white div below them. How can I get IE to render this the same as FF? I'm having a weird situation. I've got a nested divs in a big box. Anyway, I've got one div floating an image on the left and another div with text on the right. Anyway, there's not much text, but under the img div there's a gap in IE7 but not in FF and I was wondering why. For some reason the margin-bottom: 5px; in the <h3> tag causes there to be the gap under the floating div holding the img. I'm wondering why this is happening in IE7 but not in Firefox. I created an example code to show what I mean and placed comments around the h3 tag that seems to be the cause. I put all the css in the html using style tags. I have a screenshot but it doesn't look like I can attach it. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <title>test</title> </head> <body> <!-- A big box to hold everything --> <div style="border-style: solid; border-color: #777777; margin-top: 10px; margin-bottom: 10px; width: 400px; padding: 0;"> <!-- the Image Div that holds the 100x100 pixel image and floats on the left in the big box --> <div style="float: left; width: 106px; height: 106px;"> <img src="test.jpg" alt="Picture of Test Image" style="display: block; width: 100px; height: 100px; border-style: solid; border-color: black; border-width: 3px; margin: 0;" /> </div> <!-- This is the text Div that holds an H3 heading Keep a 106px margin to prevent any later text from wrapping. Neither Removing the margin nor the padding HERE solves the problem only the margin-bottom in the h3 tag style seems to matter --> <div style="margin-left: 106px; padding-left: 10px; margin-right: 0; margin-bottom: 0; margin-top:0;"> <h3 style="margin-top:5px; margin-bottom: 5px; border-style: solid; margin-left: 0; margin-right: 0;">Test</h3> <!-- HERE'S THE QUESTION! why does the "margin-bottom: 5px;" leave a gap 5px gap underneath the image in IE7 but not firefox. Who's wrong? IE7 for putting the gap in or firefox for not floating things correctly? The H3 should be WELL away from the bottom of the div with most font sizes...Also oddly enough, enclosing the parent div of the h3 in a border removes the gap under the image BUT a border around the h3 itself does NOT Why the gap? --> </div> <!-- This div stops the floating --> <div style="clear:both; margin: 0; margin-right: 0; padding: 0; width: 0; height: 0;"> </div> </div> </body> </html> |