SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question about center and text-align

    Hi,

    i have this page.

    login: fer
    password: m
    Note: after login you will be redirected to another page. Then click again the link i mention.

    Im trying to center the form using "margin: 0 auto" but it doesnt work.

    Im also trying to align the labels on the right through "text-aling: right" but it doesnt work..

    Any help?

    Regards

    Javi

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    First off you need a doctype to put all browsers into standards mode so that they'll recognise the margin properly. Without that all browsers will behave differently.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Guru Luki_be's Avatar
    Join Date
    Jun 2008
    Location
    Brazil, Minas Gerais. But i'm from Belgium.
    Posts
    867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haven't looked at the page but are you setting a width? Without a width the auto margins will not work...
    SitePoint Guru
    Sitepoint - the ultimate Css well
    As a computer, I find your faith in technology amusing.
    Sitepoint reference, your friend in need

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Luki_be View Post
    Haven't looked at the page but are you setting a width? Without a width the auto margins will not work...
    It is in a table so it shouldn't need a width but it will need a doctype.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,724
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tirengarfio View Post
    Hi,

    i have this page.

    login: fer
    password: m
    Note: after login you will be redirected to another page. Then click again the link i mention.

    Im trying to center the form using "margin: 0 auto" but it doesnt work.

    Im also trying to align the labels on the right through "text-aling: right" but it doesnt work..

    Any help?

    Regards

    Javi
    If you're talking about IE then yes, IE in quirks mode doesn't recognize auto margins. A doctype as mentioned above will fix this.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com


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
  •