Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts

    max-height not working?

    ok i may have done something a bit wrong here... but i'm not sure i don't think i did.... so here's the problem. i'm working on my a website for my buddy, and for his opening page, i've made a picture with blurred edges and that jazz. that's all well and good so the problem comes when i set it to size. i can't keep it from having white space at the top and right side...
    Code:
    body{background-image:url("bg.jpg");
    background-repeat:no-repeat;
    -moz-background-size:1250px, 150%; 
    background-size:1250, 150%;
    }
    anything especially wrong with that?
    thanks all!

  • #2
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    947
    Thanks
    0
    Thanked 130 Times in 129 Posts
    you cannot set the size for a background. And neither can you scale it.

    You can set the size for the element that have the background, and set alignment or distance from edges of the element. and if it should repeat or not

    e.g.
    Code:
    body{background-image:url("bg.jpg");
    background-repeat:no-repeat;
    background-postion:top center;
    }

  • #3
    New Coder
    Join Date
    Mar 2012
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts
    really? i thought it was a new css3 thing..
    http://www.w3schools.com/css3/css3_backgrounds.asp (if could look at this and tell me if i HAVE made a mistake lol. thanks)

    thanks for your quick reply

    i think i misunderstood. in that you can't set the bg size for the body. unfortunetly i've got it now that it's short enough but i'vestill got space on the side, no matter how long i set it to be.
    Last edited by flight567; 05-05-2012 at 06:50 AM.

  • #4
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    947
    Thanks
    0
    Thanked 130 Times in 129 Posts
    Well! I wasn't aware of this new property! Now I am!

    But you need to specify some units, and you must remove the comma in the value.

    Code:
    body{background-image:url("bg.jpg");
    background-repeat:no-repeat;
    -moz-background-size:1250px 150%; 
    background-size:1250px 150%;
    }

  • #5
    New Coder
    Join Date
    Mar 2012
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts
    ok, i'll try it. thanks!
    yea, the new properties are cool lol. it's my first time using html5 and css3 in the same document lols. can you explain to me exactly what <header> or<footer> does for you? it doesn't really seem to do anything.... just saying.

  • #6
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    947
    Thanks
    0
    Thanked 130 Times in 129 Posts
    The header and footer tags are not supposed to do anything.

    They are to define that the content are either introductory to the document (header), or author information (footer), and are typically placed in top or bottom of the document respectively

  • #7
    New Coder
    Join Date
    Mar 2012
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts
    so after some experimentation, i've determined that it's the margin-bottom attrib later down, to vertically center some textis what's screwing me up...however i've fixed it! (px is wonderful!) so my question is, should i put the text ontop of the image or "in" it?
    so they are just organizational tags?
    Last edited by flight567; 05-05-2012 at 07:17 AM.

  • #8
    Regular Coder Lerura's Avatar
    Join Date
    Aug 2005
    Location
    Denmark
    Posts
    947
    Thanks
    0
    Thanked 130 Times in 129 Posts
    margin bottom is not for centering content.
    It is to push the tag and it content away from the edges of the parent or sibling tags.

  • #9
    New Coder
    Join Date
    Mar 2012
    Posts
    23
    Thanks
    2
    Thanked 0 Times in 0 Posts
    that explains why it did that. lol


  •  

    Posting Permissions

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