SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    css centering and offsetting?

    Hi!

    Im trying to center a div on a page but offset it from the centre just slightly to the left..i found a quick workaround with placing it 50% from the left and giving it a negative margin which does seem to work:

    http://www.curlykale.co.uk/dentalplusnew/menubar.html

    until the screen is shrunk and the logo disappears off the screen to the left (its the logo im trying to get this to work on)

    If anybody has any ideas i would be most greatfull!

    keep it funky!

    :-)
    RiverCottage

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    You could try something like this.
    Code:
    #mydiv {
     position:relative;
     margin-top: 7px;
     width:700px;
     height:35px;
     margin: auto; 
      
    }
    Not sure if that will have the effect you want as I couldn't get your page to run locally to test,

  3. #3
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi

    thanks for a super quick response! your code works! and does exactly what i wanted to do!

    http://www.curlykale.co.uk/dentalplusnew/menubar2.html

    A MASSIVE big thanks from me! you've made my day!

    :-)
    RiverCottage


Bookmarks

Posting Permissions

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