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.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Senior Member
    Join Date
    Mar 2004
    Posts
    1,518
    Member #
    5220
    I am stuck. I'm trying to position my background with CSS. I have used the code:

    Code:
    style="background-repeat:repeat-x;border-right:1px solid #FFFFFF;background-position: x-0px y-2px"
    But it just stays in the same place - how come? Anyone got any ideas as to how I can position it right? I want to be 0px from the left, and 2px up from the bottom...
    Rednerve
    Creative Freelance Design

  2.  

  3. #2
    Senior Member Fallout's Avatar
    Join Date
    Aug 2003
    Location
    Richmond, Virginia
    Posts
    543
    Member #
    2748
    I think you need to lose the "x-" and "y-" stuff. Try that

  4. #3
    Senior Member
    Join Date
    Mar 2004
    Posts
    1,518
    Member #
    5220
    Apparently (according to W3Schools) you can do that - how else will I get it 2px up from the bottom?
    Rednerve
    Creative Freelance Design

  5. #4
    Senior Member Riat_Sila's Avatar
    Join Date
    Oct 2003
    Location
    Berkshire, UK
    Posts
    417
    Member #
    3485
    You shouldn't need them, CSS passes shorthand in a certain order anyway. Try background-position-x:value;

  6. #5
    Member
    Join Date
    Sep 2004
    Posts
    68
    Member #
    7417
    post your fiels or at least a link so we can see it. instead of "0px 0px" use "bottom left" but that of course puts it at the bottom so maybe there's another way to achieve what you want. using 0px-2 means you're displaying 2 pixels above the TOP of the browser! you may have to settle for a % or some such but i can't tell unless i see your shtuff so i can see what effect you're trying to achieve.

  7. #6
    Member forwardtrends's Avatar
    Join Date
    Jan 2003
    Location
    Pittsburgh, PA USA
    Posts
    69
    Member #
    498
    try naming the background in the css instead of HTML (I'm assuming you did a <BODY background="something.jpg">)

    Try this:

    body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 2px;
    background-repeat: repeat-x;
    background-color: #FFFFFF;
    Aaron Elliott
    www.forwardtrends.com

  8. #7
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    There is not exactly a way to do this. At least not though CSS only.

    My solution(provided you are using a gif) involves you altering your background image by making it 2(transparent) pixles taller on the bottom then using this instead of your code above.
    HTML Code:
    style="background: url(image.gif) repeat-x 0px 100%; border-right:1px solid #FFFFFF;"
    However this will not work if you need a jpg for your background image. In that case I suggest making the bottom two pixles the same color as your background or using a png24 and incorporating the IE workaround to get it to work properly in IE.

    Note: FYI Will, you left out the last semi-colon in your code snippet above.


  9. #8
    Senior Member
    Join Date
    Dec 2003
    Posts
    1,274
    Member #
    4362
    Quote Originally Posted by glyakk
    Note: FYI Will, you left out the last semi-colon in your code snippet above.
    Actually, I always let the last semicolon out, to save a few bytes in the CSS. I also create a "difficult to read" version of the CSS file once I'm happy with it, by removing all the spaces and line breaks, to make it lighter

  10. #9
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    Under most circumstances, leaving the last semi colon out will not affect your site. However there is the off chance that it might and I cannot justify taking that chance when the actual file space being taken up is so minimal and it technically is supposed to be there.

    My CSS is NEVER to my liking it is always evolving, so removing spaces and line breaks would do nothing but create a living hell for me when I need to make changes. But that is a good tip if you are not an obsessive compulsive like me.


  11. #10
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    138 times
    O.C.? YOU? Naaaahhhhhh... Not the guy who has a green para-military fuzzy wuzzy as his avatar...
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com


Page 1 of 2 1 2 LastLast

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 10:25 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com