#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    3
    Rep Power
    0

    Box widht stays unaffected


    Dear reader,

    I have created a box (which stands below another box) with a widht. The set widht however doesnt change, the box widht stays the same (which is till the end of the page).

    The code i have now =
    Code:
    #boxactiviteiten {background-color: #00FF33; 		 		display: block; 		 		
    widht: 50px; 		
    padding: 5px; 		 		 		 		position:relative; 		
    left:400px; 		
    text-align: center; 		
    }
    I try'd to use and change all sort of stuff to get the widht changed but it doesnt seem to work. Try'd to use lenght, min and max widht, float center and so on.

    Anyone got a clue why my box widht stays unaffected?

    Thx in advance!
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,126
    Rep Power
    4304
    Welcome to DevShed Forums, Nicolas1989.

    You've mistyped "width" and "length". Also "center" is not a valid value for the "float" property.

    The first step in debugging should always be making sure that your code is valid (in order to rule out any errors as the cause for the problem).
    http://validator.w3.org/
    http://jigsaw.w3.org/css-validator/ (Under "more options", make sure the "Profile" is set to "CSS level 3" and set "Vendor Extensions" to "Warnings".)

    What relative positioning does is shift where an element appears to be without affecting the footprint of the element, so that other elements (that are not descendants of it) will act as if it's not relatively positioned. It's mostly only useful for making slight adjustments to positioning or sometimes for changing the order of columns. Here's a demo: http://www.css-101.org/relative-positioning/index.php
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    3
    Rep Power
    0
    Ah thats really really stupid of me haha. The last thing i wouldnt thought it would be was the spelling and cinda looked over it!

    I figured out the 'center' not being a valid string just when i posted this message!

    Thanks a lot for the reply and advice!

IMN logo majestic logo threadwatch logo seochat tools logo