Closed Thread
Results 1 to 4 of 4

Thread: Really Quick and Easy question about positioning in CSS

  1. #1
    tradingjamie is offline Learning Programmer
    Join Date
    Mar 2009
    Posts
    37
    Rep Power
    0

    Really Quick and Easy question about positioning in CSS

    Hi guys,

    Hopfully this will be a really easy question for you...

    basically I have some css code:

    Code:
    #container {
    	background-color: #CCFFCC;
    	margin: 0px;
    	padding: 0px;
    	width: 1000px;
    	height: 2000px;
    }
    #header {
    	background-color: #009900;
    	height: 150px;
    	width: 950px;
    }
    #logo {
    	background-color: #FF6600;
    	height: 150px;
    	width: 150px;
    }
    #search {
    	background-color: #0033FF;
    	height: 150px;
    	width: 150px;
    	float: right;
    }
    Ive just made them colour boxes to help me out see them.

    Then in an index.php file I have the following:

    Code:
    <div id="container">
    
      <div id="header">
        <div id="logo"></div>
        <div id="search"></div>
       </div>
       
    </div>
    The result is this:

    w3.zeeboodee.com (cant post urls)

    The thing is that how do I edit the code so that the blue box goes inside the green header box? At the moment it is sitting outside it to the bottom right, but I want it to be inside to the right.

    Any ideas?

    Thanks very much

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: Really Quick and Easy question about positioning in CSS

    You have some errors in your HTML, you never end <HEAD> (should be after you link to the CSS) and you do not have a <body> tag. I don't think these cause your problem, I'm just letting you know.

    Try adding
    Code:
    float: left;
    in the logo CSS. That might resolve your problem.

  4. #3
    tradingjamie is offline Learning Programmer
    Join Date
    Mar 2009
    Posts
    37
    Rep Power
    0

    Re: Really Quick and Easy question about positioning in CSS

    Thanks Jordan - the float left worked.

  5. #4
    Jordan Guest

    Re: Really Quick and Easy question about positioning in CSS

    No problem, glad it helped.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Quick (and probably easy) question regarding c++
    By mainevent403 in forum C and C++
    Replies: 10
    Last Post: 02-05-2011, 07:15 PM
  2. quick and easy programming code any takers?
    By logic in forum Services for Buy/Sell/Trade
    Replies: 7
    Last Post: 06-07-2010, 07:50 AM
  3. Quick program for easy money!
    By Noob4Basic in forum Services for Buy/Sell/Trade
    Replies: 1
    Last Post: 04-15-2010, 07:36 AM
  4. quick question (php)
    By mayo in forum PHP Development
    Replies: 2
    Last Post: 12-18-2009, 01:34 PM
  5. Can someone do this quick/easy program for me?
    By clearsights in forum C and C++
    Replies: 4
    Last Post: 09-24-2008, 01:41 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts