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 10 of 10
  1. #1
    Join Date
    Nov 2007
    Posts
    162
    Tokens
    0

    Default HTML Divs for the noobies

    Howdy! I'm assuming you're local with HTML & CSS.
    Righty! Lets start you off on how to make a simple boxed layout.
    Using the one and only HTML & CSS.

    [Note this for basic]

    Ok, Lets get our main tags up!

    HTML Code:
    <html>
    <head>
    <title> First CSS Layout </title>
    </head>
    <style type="text/css">
    </style>
    <body>
    </body>
    </html>
    Now, lets get into making the main containers!

    Lets do our body first shall we?

    HTML Code:
    body {
    height:100%;
    width: 100%;
    background-color: green;
    }
    Now, lets do our banner.

    HTML Code:
    div#banner {
    height: 200px;
    width: 100%;
    background-color: red;
    }
    Now, i'll repeat this process, editing the height and width.
    Although no need for me to spam this up! Just set your containers with your color, height and width to fit int your layout needs.

    The HTML Part

    In your body section, lets do our banner.

    HTML Code:
    <div id="banner">
    In here put your image or text
    </div>
    This is the same process with just sorting out the div preferences.
    I.e = Height, width, color, text inside it. Etc.

    Hope this helped.

  2. #2
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Erm..

    Isnt there a CSS guide alredy in tuts? :S

    Maybe put background images in instead of colours.
    Coming and going...
    Highers are getting the better of me

  3. #3
    Join Date
    Oct 2007
    Location
    UK
    Posts
    471
    Tokens
    0

    Default

    Yeah there's already one that explains it a lot better and in alot more detail

  4. #4
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Did you just set the bodys width and height to 100% or did i imagine that O.O ... (a div is most likely going to be 100% of its own size, when you dont tell it anything differnt)

  5. #5
    Join Date
    Aug 2005
    Location
    Newcastle
    Posts
    1,417
    Tokens
    0

    Latest Awards:

    Default

    Depends on the browser Carl; some browsers only size the div to it's content so if you have no content, the div will not show. I think you need a lot more comments and notes for this to be a good tutorial. All you really say is do this and do that, it would be good to show the user a step by step guide and possibly images or external pages. Nevertheless good to see you passing on your skills.
    Last edited by craigg.; 28-11-2007 at 09:12 PM.



  6. #6
    Join Date
    Nov 2007
    Posts
    162
    Tokens
    0

    Default

    Meh, i'm not so good explaining, so I tried it out.
    Came out better than expected.
    Thanks a bunch Craig

  7. #7
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Maybe go on to explain the diff between classes and ids?

    Cos right now, its pretty much basic knowledge to everyone on this forum.
    Coming and going...
    Highers are getting the better of me

  8. #8
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by craigg. View Post
    Depends on the browser Carl; some browsers only size the div to it's content so if you have no content, the div will not show.
    Which browser might this be as ive yet to come across one with this behavior? Even IE manages to implement that one right. Spans are the ones that size to there content.

  9. #9
    Join Date
    Nov 2007
    Location
    A House?
    Posts
    137
    Tokens
    0

    Default

    The problem I have with making websites is getting my PNG template image into Dreamweaver, and turning it into a site..
    Please send all enquiries to...

    [email protected]





  10. #10
    Join Date
    Aug 2005
    Location
    Newcastle
    Posts
    1,417
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by 01101101entor View Post
    Which browser might this be as ive yet to come across one with this behavior? Even IE manages to implement that one right. Spans are the ones that size to there content.
    http://craig.recoding.net/test/test.html , I think I may have misread your post so I'm confused slightly now. Have a look at that. Two div's one with, one without text but only one shows.



Posting Permissions

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