Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: CSS Alignment Help

  1. #1
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CSS Alignment Help

    I am trying to use the script Pausing Up-down Scroller http://www.dynamicdrive.com/dynamicindex2/crosstick.htm on my website. I have the script itself working, but the issue is that I can not get the box that is created using the CSS to align to the center of location that I want it.

    I am using the script listed on the above page, as is, with the larger box, but I can't get the box to center, here is the CSS code:

    #pscroller1{
    width: 200px;
    height: 100px;
    border: 1px solid black;
    padding: 5px;
    background-color: lightyellow;
    }

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Try:
    Code:
    margin: 0 auto;
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It looks like that did it, thanks for the help.

  4. #4
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oops, I though it worked, well it did in Firefox, but it still is not centered in IE. Any suggestions? Here is the page I am working on http://www.southernrescue.org, any help will be apperaciated as this is for our non-profit.

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Oh, I forgot about IE. Also use:
    Code:
    text-align: center;
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmmmmm,

    That centered the text in the box in Firefox, and it "centered" it in the box in IE, but it did not center the box itself in IE. Let me know what you think, I might just leave it like it was.

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Gah, IE.
    There's one other rather nasty hack you can use, which is to put the element inside a three-cell table with each cell width set to 33%.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    LOL, I think I'll leave it as is and let the IE people think about why it's not centered

  9. #9
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    Oh, I forgot about IE. Also use:
    Code:
    text-align: center;
    You didn't mention that that should be applied to the parent element, and it should only be necessary for versions of MSIE earlier than 6. That is, unless the document triggers Quirks mode.

    Mike

  10. #10
    Join Date
    Aug 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    In the above mentioned script, were would it be placed to be considered applied to the parent element?

    I perosnally am still learning CSS and have very little experience in using it, expect what is already included with site templates I might be working with.

    Any help is welcome.

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
  •