1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

I'm struggling with a simple CSS "Margin" Shift!!

Discussion in 'CSS' started by M3rC, Dec 29, 2008.

  1. #1
    I've spent about a week trying to figure this one out with no luck - so I'm coming to my trusted DP CSS gurus! :D

    I'm ashamed to even call myself a webmaster because I can't do this simple CSS edit! Anyways, embarrasment aside; the problemo.

    If you visit the link in my signature (teenproblogger) you can see the big blue twitter bird -I need to move to upwards so its feet are on the navigation bar, and the head/speech cloud is on the "light-gray" header image.

    it's a simple CSS edit with like "margine -10px" or something, but everything I tried fails.. can someone please tell me both the HTMl & CSS code?

    Thanks :)
     
    M3rC, Dec 29, 2008 IP
  2. Ulquiorra

    Ulquiorra Peon

    Messages:
    422
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Add this to your css, at the end:

    .twiimg { position:relative; top:-85px; }
    Code (markup):
    That's it.
     
    Ulquiorra, Dec 29, 2008 IP
  3. M3rC

    M3rC Peon

    Messages:
    1,493
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Awesome, appreciate it Ulquiorra,
    I"ll test this out when I get back - about to go out.

    Thanks buddy :)
     
    M3rC, Dec 29, 2008 IP
  4. M3rC

    M3rC Peon

    Messages:
    1,493
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It worked to a certain level. The bird-image moved fine but there's still a gap (which is shown in red);
    [​IMG]
     
    M3rC, Dec 30, 2008 IP
  5. Ulquiorra

    Ulquiorra Peon

    Messages:
    422
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Add:
    position:relative;
    top:-60px;
    Code (markup):
    In your #wrap and #footer css. Alternatively, you can absolute position the twitter bird.
     
    Ulquiorra, Dec 30, 2008 IP
    M3rC likes this.
  6. M3rC

    M3rC Peon

    Messages:
    1,493
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thank You sir! +repped :)

    The absoulete position worked a charm, had to play around with the left and top margins but eventually got it placed :D
     
    M3rC, Dec 30, 2008 IP
  7. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #7
    The position:relative is NOT going to work in IE as is. Case in point your birdie is appearing way off to the left side of the screen.

    I rarely use absolute positioning, but in this case I'd seriously be considering it... that or the negative margin. Margin-top:-60px; combined with position:relative; should move it, with the position:relative changing the depth sorting.

    The problem with position:relative is you end up reliant on the natural flow position of the element, and said element's 'flow box' is not moved, hence that 'gap' you had.

    Though as I've already said to ten other people today, with 56 validation errors you do not have HTML, you have gibberish, and with 68k of markup for 17k of content, you have three to four times as much HTML as needed for such a simple page - further exacerbating any layout issues.
     
    deathshadow, Dec 30, 2008 IP
  8. Ulquiorra

    Ulquiorra Peon

    Messages:
    422
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Just put it in your sig, deathshadow :p
     
    Ulquiorra, Dec 30, 2008 IP
  9. M3rC

    M3rC Peon

    Messages:
    1,493
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #9
    The position absolute worked a charm!
    Thanks buddy :D appreciate your helpp

    @deathshadow - so positive:relative WON't work with IE?
     
    M3rC, Dec 31, 2008 IP
  10. Ulquiorra

    Ulquiorra Peon

    Messages:
    422
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Yep, I saw that. Thanks for the rep :)
     
    Ulquiorra, Dec 31, 2008 IP
  11. M3rC

    M3rC Peon

    Messages:
    1,493
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #11
    No worries, you deserve it :)
    I'd rep you again but doesn't let me :p

    cause technically speaking - you helped me twice :rolleyes:
     
    M3rC, Dec 31, 2008 IP
  12. bhagwat_banna

    bhagwat_banna Peon

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    position:relative; top:-85px;
     
    bhagwat_banna, Jan 1, 2009 IP