Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 8 of 8
  1. #1
    Join Date
    May 2005
    Location
    Yokohama (Japan)
    Posts
    6,499
    Tokens
    0

    Latest Awards:

    Default Basic css/html help needed +21 rep

    Hey
    I started learning html and css today and have a question.
    Currently i have three div's each expands when more text is added - However if i was to have one box above the other (Height wise)
    could i make it so that when the top expands the bottom one moves down so that they are always the same distance eg 50px from each other?

    I have no idea if the coding is good - i started today and previewing it it seems to work lol..
    It's linked into a html document and i can supply that code if needed..
    Code:
        body {background: #ABABAB; 
        font-family: "comic sans ms",ariel, sans-serif; 
        color: black;}
        h1 {color: #7A7A7A; 
        text-align: center;}
        h2 {color: #7A7A7A; 
        text-align: center;}
    
        div.col1 {width: 400px;
        background: white;
        font-size: 10pt;
        padding: 10px;
        border-style: solid;
        border-size: 1px;
        border-color: black;
        position:absolute;
        top: 100px;
        left: 150px;}
    
    
        div.col2 {width: 150px;
        background: white;
        font-size: 10pt;
        padding: 10px;
        border-style: solid;
        border-size: 1px;
        border-color: black;
        position:absolute;
        top: 100px;
        left: 600px;}
    
        div.col3 {width: 600px;
        background: white;
        font-size: 10pt;
        padding: 10px;
        border-style: solid;
        border-size: 1px;
        border-color: black;
        position:absolute;
        top: 36px;
        left: 150px;}
    
    body {
        margin-top: 50px;
        margin-right: 50px;
        margin-bottom: 50px;
        margin-left: 50px;}
    (゚Д゚≡゚Д゚)

    Roy: [singing] We don't need no education.
    Moss: Yes you do; you've just used a double negative

  2. #2
    Join Date
    Jul 2006
    Location
    Athens
    Posts
    842
    Tokens
    0

    Default

    I don't think you can do that unless you can with javascript but i doubt it.

    Other than that give the div that expands over the other one a higher z-index number.


  3. #3
    Join Date
    May 2005
    Location
    Yokohama (Japan)
    Posts
    6,499
    Tokens
    0

    Latest Awards:

    Default

    Ok thanks +rep

    I'll leave the thread open for others to reply.
    Quote Originally Posted by Reina View Post
    I don't think you can do that unless you can with javascript but i doubt it.

    Other than that give the div that expands over the other one a higher z-index number.
    (゚Д゚≡゚Д゚)

    Roy: [singing] We don't need no education.
    Moss: Yes you do; you've just used a double negative

  4. #4
    Join Date
    Jul 2005
    Posts
    1,653
    Tokens
    50

    Latest Awards:

    Default

    Not 100% sure what your after, but .. margin-top: 50px;

  5. #5
    Join Date
    May 2005
    Location
    Yokohama (Japan)
    Posts
    6,499
    Tokens
    0

    Latest Awards:

    Default

    I'll explain in more detail.

    Say i have Two content boxes above each other, they both expand downwards when more text is added. If i was to add text to the one above the lower one and it expands - is there a way i can make the lower box always stay the same distance from the top box, so when it expands they are both say 50px from each other.

    Quote Originally Posted by RYANNNNN View Post
    Not 100% sure what your after, but .. margin-top: 50px;
    (゚Д゚≡゚Д゚)

    Roy: [singing] We don't need no education.
    Moss: Yes you do; you've just used a double negative

  6. #6
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    <div height="HEIGHT HERE"> your HTML here </div>

    EDIT: Read your above post.

    Yes you just do as i did above and put the same code underneath, the top one will expand but keep the bottom one the same distance away
    Last edited by Ini; 18-06-2007 at 08:05 PM.
    Looking for a good desiner to design a social networking template.

    PM me.

  7. #7
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    As long as you never coded it using absolute positioning, it should do it anyway.

  8. #8
    Join Date
    Feb 2007
    Location
    Essex, England
    Posts
    1,392
    Tokens
    0

    Latest Awards:

    Exclamation

    Wait, are you asking that if you have two boxes, when more stuff was added in the top, the bottom one moves down when it expands?

    Cos if you are, that's easy.

    The (X)HTML:
    HTML Code:
    DOCTYPE..
    <html>
     <head>
      <title></title>
      <link rel="stylesheet" type="text/css" href="blah.css" />
     </head>
     <body>
      <div class="boxcontainer"> <!-- This keeps the two boxs in a column -->
        <div class="box1">
        <p>You're text goes here. blah blah etc. Yes :)</p>
       </div>
     
        <!-- There isn't any more space left horizontally, so the 2nd box has to go below. -->
     
        <div class="box2">
         <p>You're text goes here. blah blah etc. Yes :)</p>
        </div>
       </div>
      </body>
     </html>
     

    The CSS:
    Code:
    .boxcontainer {
        width: 150px;
        height: 100%;
        padding: 5px 10px 5px 10px; /* We have 130px of sace in there ;P */
        }
    .box1 {
        width: 130px; /* Could be 100% */
        padding: 10px;
        height: 100%;
        margin-bottom: 50px;
    }
    .box2 {
        width: 130px;
        padding: 10px;
        height: 100%;
        margin: 0 0 0 0;
        }
    Last edited by L?KE; 18-06-2007 at 08:22 PM. Reason: No reason


Posting Permissions

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