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!


Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Aug 2006
    Location
    London
    Posts
    1,907
    Tokens
    0

    Latest Awards:

    Default [Tut] Basic Css/Div Expandables.

    A basic guide to css/div expandables.

    Lets make an expanding square.

    Part one: Telling the css What to do and using a div Id.
    HTML Code:
    <html> <style type="text/css"> #div1 {border: solid 1 px purple width: 300; Height: 300;} </style>
    <div id="div1">This box will be purple and will expand when you add more text :):)</div>
    You can format this by changing it from an expanding box to a box with a scroll bar instead.

    Using A scroll bar.
    HTML Code:
    <html> <style type="text/css"> #div1 {border: solid 1 px purple width: 300; Height: 300; Overflow: scroll;} </style>
    <div id="div1">This box will be purple and will have a scroll bar when you add more text.</div>
    Adding a custom content box.
    First you need to slice the box into 3 parts. A header, a Footer and a middle. You also need the pixel size of each slice.
    For my box the sizes will be:
    Header 50x10 Image name will be Head.
    content 50x50 Image name will be content.
    footer 50x10 image name will be foot.

    The code.
    HTML Code:
    <html> <style type="text/css"> 
    
    #div1head {background-image: url(/images/head.png); width: 50; Height: 10;  overflow: hidden; }  
    
    #div1 {background-image: url(/images/content.png); 50; Height: 50; }
    
     #div1base {background-image: url(/images/foot.png); width: 50; Height: 10; overflow: hidden;}</style>
    
    <div id="div1head">Head of content box</div>
    <div id="div1">This box will be your custom imageand will expand when you add more text.</div>
    <div id="div1base">base of content box</div>
    </html>
    Creating 2 content box's and having them on opposite sides.
    Again you need to slice the content box's into three parts.
    For my box the sizes will be:
    Header 50x10 Image name will be Head.
    content 50x50 Image name will be content.
    footer 50x10 image name will be foot.

    I will have div 2 on the right and div 1 on the left, heres how to do it.

    The code.

    HTML Code:
    <html> <style type="text/css"> 
    
    #div1head {background-image: url(/images/head.png); width: 50; Height: 10;  overflow: hidden; }  
    
    #div1 {background-image: url(/images/content.png); 50; Height: 50; }
    
     #div1base {background-image: url(/images/foot.png); width: 50; Height: 10; overflow: hidden;}
    
    #div2head {background-image: url(/images/head.png); width: 50; Height: 10;  overflow: hidden; float: right;}  
     
     #div2 {background-image: url(/images/content.png); 50; Height: 50;float: right; }
     
      #div2base {background-image: url(/images/foot.png); width: 50; Height: 10; overflow: hidden;float: right;}</style>
    
    <div id="div1head">Head of content box</div>
    <div id="div2head">Head of content box right </div>
    <div id="div1">This box will be your custom imageand will expand when you add more text.</div>
    <div id="div2"> This box will be you custom image and be on the right. </div>
    
    <div id="div1base">base of content box</div>
    <div id="div2base">base of content right</div>
    
    
    </html>
    You can then start adding more to the css like backgrounds. Add theese to the top of your css part.

    body{background-image: url(BackgroundImageHere) }

    Background just across the bottom of the page with a colour on the rest of the page:
    HTML Code:
    body {background: #000000 url('Backgroundimagehere') repeat-x fixed bottom left;}
    Background just across the left side (y axis)
    HTML Code:
    body {background: #000000 url('Backgroundimagehere') repeat-y;}
    Edited by L&#181;ke (Forum Moderator): Thread Moved from Website Designing. Please post in the correct section next time, Thanks .
    Last edited by Lµke; 09-05-2007 at 07:54 PM.

  2. #2
    Join Date
    Aug 2006
    Location
    London
    Posts
    1,907
    Tokens
    0

    Latest Awards:

    Default

    I forgot to mention that:
    - This only works in Internet explorer.
    - This is only a basic code
    - This is valid
    - Feel free to use this code

  3. #3
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    If something doesnt work on IE or Firefox (either way) it isnt really valid, as I would class it.

    Nice start but it would be better to comment on each css item, telling them what it does.
    Last edited by Luckyrare; 09-05-2007 at 03:03 PM.

  4. #4
    Join Date
    Oct 2006
    Posts
    1,026
    Tokens
    0

    Latest Awards:

    Default

    Great design, move to tutorials please.

  5. #5
    Join Date
    Aug 2006
    Location
    London
    Posts
    1,907
    Tokens
    0

    Latest Awards:

    Default

    I didnt know where to post it, as I couldnt post in the tutorial section.

  6. #6
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by :Liam View Post
    I forgot to mention that:
    - This only works in Internet explorer.
    - This is only a basic code
    - This is valid
    - Feel free to use this code
    Just made me dislike this tutorial.. other that that its good.

  7. #7
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    Great tutorial but useless for me because I use firefox all the time

  8. #8
    Join Date
    Dec 2006
    Location
    None of your business!
    Posts
    2,492
    Tokens
    50

    Latest Awards:

    Default

    Nice tutorial Liam. Well Done + rep.

  9. #9
    Join Date
    Aug 2006
    Location
    London
    Posts
    1,907
    Tokens
    0

    Latest Awards:

    Default

    sorry about it not working in Ie but it mucks up when you try it example. www.hab-towers.com

  10. #10
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    - This only works in Internet explorer.
    Then it isnt valid since IE dosent exactly conform to W3C standards. If it works in firefox then the code is valid but may have to be tweaked for viewing in IE.

    Basically learn to cross-browser code.

Page 1 of 2 12 LastLast

Posting Permissions

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