Float left not working???

Reply

Join Date: Dec 2007
Posts: 24
Reputation: plarsen111 is an unknown quantity at this point 
Solved Threads: 0
plarsen111 plarsen111 is offline Offline
Newbie Poster

Float left not working???

 
0
  #1
Apr 9th, 2009
Can anyone tell me why "Main" Div will not float left next to "Menu" div?

I can't seem to get it to go up.

Thank you!

Phil


  1. <html>
  2. <head>
  3. <style type="text/css">
  4.  
  5. div#container {
  6. font-family: "Lucida Grande", Verdana, Arial, sans-serif;
  7. font-size: 20px;
  8. width: 1000px;
  9. height: auto;
  10. }
  11.  
  12. div#title {
  13. background-color: #ff638d;
  14. text-align: center;
  15. font-size: 300px;
  16. }
  17.  
  18. div#menu {
  19. background-color: #0586b8;
  20. text-align: right;
  21. font-size: 50px;
  22. width: 300px;
  23. }
  24.  
  25. div#main {
  26. float: left;
  27. width: 500px;
  28. background-color:gray;
  29. }
  30.  
  31.  
  32. </style>
  33.  
  34.  
  35. </head>
  36.  
  37.  
  38. <div id="container">
  39.  
  40.  
  41. <div id="title">
  42. Title
  43. </div>
  44.  
  45. <div id="menu">
  46.  
  47. <li>Menu 1</li>
  48. <li>Menu 2</li>
  49. <li>Menu 3</li>
  50. <li>Menu 4</li>
  51. <li>Menu 5</li>
  52. <li>Menu 6</li>
  53. <li>Menu 8</li>
  54. <li>Menu 9</li>
  55. <li>Menu 10</li>
  56. <li>Menu 11</li>
  57. <li>Menu 12</li>
  58.  
  59. </div>
  60.  
  61.  
  62.  
  63. <div id="main">
  64.  
  65. <p>Main</p>
  66.  
  67. </div>
  68.  
  69.  
  70.  
  71. </div>
  72.  
  73.  
  74.  
  75. </html>
Last edited by Ezzaral; Apr 9th, 2009 at 4:55 pm. Reason: Added [code] [/code] tags. Please use them to format any code that you post.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,343
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 163
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: Float left not working???

 
1
  #2
Apr 9th, 2009
wrap your code in
[code=language]
code
[/code] tags leave out the blank lines
it makes it easier to read

use proper html doctypes if you want to use attributes of those doctypes
<html> means html 2.0 = no floats
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
fun isn-nit
float the menu left
Last edited by almostbob; Apr 9th, 2009 at 4:59 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 24
Reputation: plarsen111 is an unknown quantity at this point 
Solved Threads: 0
plarsen111 plarsen111 is offline Offline
Newbie Poster

Re: Float left not working???

 
0
  #3
Apr 9th, 2009
Thank you!
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1
Reputation: hitz is an unknown quantity at this point 
Solved Threads: 0
hitz hitz is offline Offline
Newbie Poster

Re: Float left not working???

 
0
  #4
Apr 10th, 2009
dude, just add "float:left" in #main id....it will work !!

Cheers
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 79
Reputation: rudevils is an unknown quantity at this point 
Solved Threads: 9
rudevils rudevils is offline Offline
Junior Poster in Training

Re: Float left not working???

 
0
  #5
Apr 19th, 2009
try to use
HTML and CSS Syntax (Toggle Plain Text)
  1. float: left;
to #menu

and
HTML and CSS Syntax (Toggle Plain Text)
  1. float: right;
to #main
If love is blind, why there's a bikini ??

Post your article at Bali Side Notes share your knowledge
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC