Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
Like Tree1Likes
  • 1 Post By TheGAME1264

Thread: styling empty div

  1. #1
    Senior Member
    Join Date
    Jan 2014
    Posts
    392
    Member #
    38172
    Liked
    4 times

    styling empty div

    last time i took a long break from learning this stuff i forgot so much. did it again...

    im just trying to make a box and add some subtle style to it for use in paint.

    [CODE]
    <!doctype html>
    <html>
    <head>
    <link rel="stylesheet" href="../css/box.css">
    </head>

    <body>

    <div class="box"> </div>

    </body>

    </html>

    {/CODE]

    so just go get bearings on size etc i gave it a background colour, radius and set the usuals i could think of

    Code:
    div .box {
    margin: 0 auto;
    position: relative;
    width: 1100px;
    height: 600px;
    display: block;
    background-color: black;
    border-radius: 5px;
    }
    i did have jusr .box and then just div now both, still no results. what am i missing

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,482
    Member #
    425
    Liked
    2784 times
    Take the space out of div .box....so make it say div.box.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    392
    Member #
    38172
    Liked
    4 times
    oh.. when i tried it as .box and div individually i didnt specify height. then i added height and changed to the both with the space.

    weird though as the space was never a problem before?

    thanks anyway

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,482
    Member #
    425
    Liked
    2784 times
    The space should be a problem...div .box is different than div.box. div .box means "any elements with the box class that are children of divs", and div.box means "any divs with the box class."
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  6. #5
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,139
    Member #
    27197
    Liked
    959 times
    Side note: if that's the whole code of your page, you don't need a class at all. Just use div, since there's only one of them.

    Extra funness: you can do
    Code:
    body *{ /* CSS stuff */ }
    /* or */
    body div{ /* CSS stuff */ }
    and it'll still select the div.
    Last edited by Ronald Roe; Mar 17th, 2014 at 08:03 PM.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  7. #6
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,482
    Member #
    425
    Liked
    2784 times
    If that's the code of his page, he needs to work on his content.
    coleio likes this.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  8. #7
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,139
    Member #
    27197
    Liked
    959 times
    To be sure. I was just trying to teach a bit about selectors. In retrospect, perhaps it was a bit vague, but whiskey will do that...
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:59 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com