#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Germany
    Posts
    22
    Rep Power
    0

    Defining centered "non-text" elements (CSS)


    Hi,

    i'm trying to define (for instance a table) to be centered on a page.
    I couldn't find a possibility to do so. The only thing i could center was text. But as soon as it comes to centering something else than text it wouldn't work.
    Of course I know that I could easely Center anything with the HTML Tag <center> but I am trying to define everything with css.
    Does anyone have an idea how I can really center things other than text?

    thx for replies, syndrome
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    25
    Erm:

    style='text-align:center'

    in the <body>

    tag??
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Germany
    Posts
    22
    Rep Power
    0

    text-align(only text ?)


    Yup, I have already tested the "text-align" option.
    But as I see it this realy ONLY aligns my text and ignores other elements as especially tables.
    I want to have my table centered and this does not happen using text-align : center.

    Or am I wrong there and my browser loves its cache ?

    thanks, syndrome
  6. #4
  7. Traveler
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    UK
    Posts
    45
    Rep Power
    12
    <center>
    <a href ="chillpadiscool.com">chillpad is cool</a>
    </center>



    (**Don't forget your towel**)
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Germany
    Posts
    22
    Rep Power
    0

    <center>...nope...not what I want


    Sorry, but as I already mentioned in my original text I don't want to use an HTML tag. Especially not <center>. That is because the <center>-tag is what w3c wants to quit being used. They rather want css to be used for everything concering layout. Thats why i'm wondering about how to center stuff without the <center> Tag.

    anyway, thnx
    syndrome

    ps: <A Href...> is in my opinion a text-element which should be centable useing text-align. I want to center thins as tables: <table><tr><td>content</td></tr></table>
  10. #6
  11. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Germany
    Posts
    22
    Rep Power
    0

    thats it


    Thanks, thats what I needed.
    Though the solution seems quite strange to me.
    I can't really follow how this is to center and why CSS doesn't have a more simple solution as may alignment:center.
    I thought I had read about the alignment operator in CSS but it didn't work anyway.

    Thanks, syndrome

IMN logo majestic logo threadwatch logo seochat tools logo