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.

Results 1 to 3 of 3
  1. #1
    Junior Member Miniie's Avatar
    Join Date
    Mar 2007
    Location
    Bronx, NY
    Posts
    12
    Member #
    14977
    I saw somewhere where this would be correct, but i've never seen it being used.
    Code:
    <p class=\"center\">
    This paragraph will be center-aligned.
    </p>
    and the CSS would be
    Code:
    p.center{text-align:center;}

  2.  

  3. #2
    Member
    Join Date
    Apr 2007
    Posts
    96
    Member #
    15165
    Quote Originally Posted by Miniie
    Code:
    p.center{text-align:center;}
    Yeah, most people just throw in the align="center" but that is a holdover from the bygone era of HTML 3. Oh how I miss those days of nested tables and copious font tags.

  4. #3
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    It does, though you don't need the \s before the quotes. It's also not particularly good style. Class names should describe structural aspects of the code, while the CSS should be the only place stylistic elements are specified.

    So you would have a class called, say, `poem', which would always be center-aligned. `poem' is a structural description -- the paragraph contains a poem. The centering is simply a stylistic definition, and a design decision.


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
  •  
All times are GMT -6. The time now is 04:02 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com