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

Thread: float: center?

  1. #1
    Senior Member duck444's Avatar
    Join Date
    Feb 2003
    Location
    east coast
    Posts
    403
    Member #
    751
    Liked
    2 times
    Does someone know why the "float: center" property never works?

    I'm trying to get the search box on a page I'm working on centered in Mozilla but it won't move over. I've tried float, align, margin left. it won't budge.

    my site is here thank you

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    What exactly are you trying to do with the box? [minicode]float: center;[/minicode] never works because `center' is not a valid value for the `float' property (i.e., there's no such thing).

  4. #3
    Senior Member duck444's Avatar
    Join Date
    Feb 2003
    Location
    east coast
    Posts
    403
    Member #
    751
    Liked
    2 times
    I'm trying to get the search box centered on the page in Mozilla. Right now it's indented to the left. I'd like it to be centered as the main banner above it is.

    I have these kinds of problems with every site I build. Do you think there something fundamentally wrong in the way I code my sites?

  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    The occasional equivalent:
    Code:
    margin: 0px auto 0px auto;
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Though... Does that work in IE? Doesn't IE require `text-align: center;' for the parent element? Or is that pre-IE6?

  7. #6
    Senior Member minute44's Avatar
    Join Date
    Mar 2006
    Location
    Nottingham, UK
    Posts
    264
    Member #
    12849
    Yeah, that works in IE...

    5&6 anyway... anyone on anything lower obviosly has no intrest in staying current so they can bite me! lol
    No ma'am, we in IT don't have a sense of humor we're aware of.

  8. #7
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Ah, yes, but it doesn't work in IE quirk mode. Well, that's an easy fix. Go doctypes! :-)

  9. #8
    Senior Member duck444's Avatar
    Join Date
    Feb 2003
    Location
    east coast
    Posts
    403
    Member #
    751
    Liked
    2 times
    perfecto :classic:

  10. #9
    Senior Member Karloff's Avatar
    Join Date
    Oct 2005
    Posts
    744
    Member #
    11702
    is it not possible to put

    margin : 0px auto

    instead of

    margin : 0px auto 0px auto

    ???

    just wondering if there is a big difference?

    cheers

  11. #10
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    It's exactly the same thing. There are three shorthands for the margin property:
    Code:
    margin: topbottommargin leftrightmargin;
    margin: topbottomleftrightmargin;
    margin: topmargin leftrightmargin bottommargin;


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
  •  

Search tags for this page

center is not a valid value for the float property

Click on a term to search for related topics.
All times are GMT -6. The time now is 04:04 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com