HTML - Why Div Width Isn't Calculated Correctly?
I have my code in short like this:
Code: <div class="out"> <div class="first"></div> <div class="second"></div> </div> .out{ width: 1000px; } .first{ width: 500px; float: left; } .second{ width: 500px; float: left; } Suppose, 500 + 500 = 1000, which should fit in the outside div in one line. But my browser will make the second div into new line. I keep trying different numbers, and turns out around 500, 480 will fit in. Where is the missing 20 width? I also tried like margin: 0; border: 0;, still no luck. Thanks for your help. Similar Tutorialsim creatinh a box containing a text. The box must be wide enough to fill a text. menu.style.width = tekst.length - this functioin gives the number of letters in text. So if the text is "hello" then the width is 5 pixels. But i need the widith of pixels needed to fit the text in a box. How can i do that? Hi, Is there away to force my website to fit an Iphone screen when viewed on the iphone. At the moment the width doesn't full span the Iphones screen so it looks bad. http://pjm.co.uk.uksite4.yourwebserv...splay&PageID=5 Thanks alot Joe I am a total newbie to this and so I have no idea what is going on. I downloaded a template from a wesite I forget which, but it looks great in IE, and Safari, however in Firefox, or Opera it is all screwed up. The site is www.ottersupport.com would somebody mind look at the code and let me know what i need to fix ? Thanks Hello, I'm new here and I hope here is the best place to ask for help. Recently i found a piece of code on the net that will allow me to watch online different pictures. I have 499 folders and sorted them as 01 02 03 04 05 06 07 08 09 11 12 13 14 15 .... 100.....150.....350...499 but in my ftp client everything is messed up(filezilla) after i upload them on my server when i want to watch them .. the list appears like this: after folder no.10 i have folder no.100 and after folder 199 i have folder no.20 .. and so on .. how could i fix them so that the numbering would be correct ? Hi everyone I've developed a website and now when it got ready someone discovered that the sidebar isn't floating correctly in his mozilla firefox. It works fine in my firefox and IE and in his IE, but not in his FF. So I have a screenie how it looks like when it's wrong and when it's right: Right: Wrong: The source is at www.latvala.com Please help me Hello everyone, I'm new here. I hope someone will help me with my problem. You can see it he http://kahoe.monline.dk/portfolie2/index.php EDIT: Problem 1 solved. Problem 1 is in the grey menu to the right. I've used php include_once to insert four div elements (with images and a little text), but they position themselves in a strange way. It's supposed to be a collumn. You can see the html file with the four elements he http://kahoe.monline.dk/portfolie2/globalmenu.html I should probably say that I've used javascript to make a hover effect with the images. (Do I need to include code in this post, or do you guys usually view CSS and HTML in the browser?) Problem 2 is with IE. I have IE 8 installed, so I don't know about other versions, but this one can't find the images on my website. It works fine in Firefox. What's wrong? Problem 3 is with the div element at the top of the page, the one which contains the text "Denne hjemmeside ses bedst med Firefox. Download Firefox her. " I can't get it to sit at the very top of the page. I've used body { margin: 0; padding: 0; } in the stylesheet already, but it's not enough apparently... I want to know why the following code doesn't work correctly: Code: <table> <tr> <td rowspan="2">Square</td> <th colspan="2">Title</th> </tr> <tr> <td colspan="2">Information</td> </tr> <tr> <td colspan="3">Long description fits in here.</td> </tr> <tr> <td colspan="2">Why, oh why?</td> <td>pt</td> </tr> </table> It should make a table with three columns, the third column is only really used in the bottom line. Is this just a problem with the way html is read or what. I presume this isn't just a browser issue, but in any case I'm using Firefox 2. Cheers. I designed a website for a client. It shows fine on my mac in Firefox but the CSS isn't loading properly in Windows Browsers because the background and the Link details aren't loading at all. What could be the issue? http://kangazoomparty.com/kangazoom.html This is the website btw. I'm sure there is a simple answer to this or I hope so. I don't have much computer code experience so I'm just going with trial and error. Anyway, my question is concerning the output of my navigation links. Its setup like this in template <ul> <li>[Navigation]</li> </ul> this outputs a set of about 10 links that look like this in the code ul> <li> link <br/> link <br/> link <br/> </li> </ul> It works but I need the code to look like this for it to function right. ul> <li> link </li> <li> link </li> <li> link </li> </ul> how do i code that using the [Navigation] Variable thanks a ton I am having trouble getting everything to fit correctly on a page. Below is a picture of my page and the sections I have split it up into. As you can see, the problem lies in the banner on the right. It is longer than all of the other rows, but I can't split it up because it is a banner. The way I have set up my page is by creating a table and then each row is another table in side of the first table. I'm not sure if this is even correct. How do I go about setting up my page so that everything fits together (including the banner)? (this is a picture of what's wrong) Hi All, I need help as fast as possible for a non profit which I have co-founded. I am a native linux/firefox user, one of the other members had told me that there is an issue in IE with our website but hadn't really told me how bad it was. I checked it out today and it is HORRIBLE. We are sending out a newsletter in the next week which will probably significantly increase traffic to our website so getting it solved is crucial. I can provide any code that I have worked on in order to find help. the website is www.cleaneducation.org the website works fine in Firefox in Windows/Linux and Mac but IE does not work. Please visit the site using firefox and IE to see what I mean. I'm in a bit of panic mode over this Thank you much I have been trying to add a text field to a pre-existing form which is submitted to my email. It is an order form and I want to add an area for the user to input their country. It shows up on the webpage but when I get the information the user has submitted in my email the Country data is not coming through. The webpage is http://earfdn.org/form11.htm The problem is towards the bottom under the Ship To: title. Please help! And thank you so much for your time. I'm new to HTML/CSS, and I thought I managed to get my website just right... until i tested it in IE. (I now understand why IE is the bane of our existence!) All versions of IE (and Opera, for that matter) make my divs display lower than I intended. My webpage is comprised of many divs, two of which are my main problem. I have two divs serving as the main content (one is an intro to the site, one is a calendar). I would like these two divs to be side by side, at the same height, roughly 10ish pixels below my navigation bar... this is easily achieved in firefox and safari, BUT in IE they get weirdly pushed down on the page. Also, my title div has a habit of being shrunk in height from 175 pixels to around 25 in some versions of IE. This is causing much headbanging! In summary, I need suggestions on how to position my divs. Right now I am using absolute positioning for everything, but I have also tried relative positioning and using floats; however, no matter what I do, I end up with some other problem that I cannot solve, and these are too numerous to go into detail here. If you can help me, a million thanks! If you want to look at my code, the website is http://www.studentgroups.ucla.edu/tbsek THANK YOU IN ADVANCE for any ideas you have! I have just recently been given a site and need some help the site is called www.prizeking.co.cc and I have a question, My site is scripted in php i use a ftp client to upload to my host,When you click a button to go to a different page e.g.(login) it says its at that page in the url but everything is the same as the homepage... ill show you how the buttons are scripted: <li><a href="login.php">login</a></li> Is that right also i would like to know how to script some text and a picture into that white box. www.lasrocasresort.com , IE and Firefox both render the page correctly . Safari will leave a blank line between the flash banner and the body of the page. Any suggestion ? Pakal Hello all, Need help with the HR aka 'a Line' I cannot get it to do what I want. Im trying to put a bit of spacing underneath the first image, bit like the second one but it should be more.... Plus im trying to add space underneath the last image so it doesnt just stop... can anyone please help. www.chappo.co.uk/years_ahead on the 'Brand' page. or www.chappo.co.uk/years_ahead/brand.htm it displays differently in both browsers but either of them do what I really wont, just one or the other.... Well, this is the first CSS layout i've made, the site right now is EXACTLY how I want it to look, but I think somethings not right... if I fill up where it says "How about some links? " too far, the footer goes to the top of the page, and the "Welcome" ends up in the navigation menu Here is the link Hi, I have made a website that is scalable, but the problem is that it is not showing correctly in Internet Explorer. It works fine in Firefox. (2.x) site: http://www.haaga-helia.fi/~a0500249/pohja/index.html I don't know where the bug is. I ran it with w3c validator and it was fault free. Something to do with the css file, but I don't know where. Help is appreciated. Sincerely, Juha Ok, I got my site to work in Safari and FF, but the only problem I am having is that in IE in the banner there is a black bar that runs accrossed.. And I can't seem to find out what is causing this.. http://www.clandestinedesigns.com/ccinsurance Would anyone be able to help me fix this? Thank you nvm lukus thanks Ive got it padding: 2.3 em 0; to li:hover and it works |