Results 1 to 4 of 4

Thread: Not Centering

  1. #1
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    130
    Thanks
    49
    Thanked 0 Times in 0 Posts

    Default Not Centering

    Good morning (or, for you blokes across the pond, afternoon) folks. Here's my stumper du jour:

    The following code is not centering:

    Code:
    <center><h2>Eviction from Residential Premises</h2></center>
    I've tested this in (a very early edition of) Firefox, as well as in relatively up-to-date Google Chrome. w3c testing comes back clean. The page, should anyone care to see it, is http://www.njmarijuana.com/page.php?here=housing.

    Comments welcome.

    A.
    Last edited by marain; 06-28-2013 at 04:37 PM. Reason: Mark "Resolved"

  2. #2
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    594
    Thanks
    43
    Thanked 28 Times in 28 Posts

    Default

    In the css file here:
    <link rel="stylesheet" type="text/css" href="css/njmarijuana.css" />
    you have the h2 heading set as:
    h2 { text-align:left; font-size:large; }

    Try changing that to center and remove those center tags.

    My test page is here:
    http://www.web-user.info/test/pot/page.php

    It seems to have centered those h2 headings as you were trying to do.
    Last edited by ajfmrf; 06-23-2013 at 03:57 PM. Reason: add note/format
    Thanks,

    Bud

  3. The Following User Says Thank You to ajfmrf For This Useful Post:

    marain (06-23-2013)

  4. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,953
    Thanks
    43
    Thanked 3,195 Times in 3,157 Posts
    Blog Entries
    12

    Default

    That would work but would also center text in all other h2 elements. That may or may not be desirable.

    If it's not, you could make up a class in the stylesheet:

    Code:
    .center {
    	text-align: center;
    }
    Then in the markup get rid of the center tags again, and add the class:

    Code:
    <h2 class="center">Eviction from Residential Premises</h2>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    marain (06-23-2013)

  6. #4
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    130
    Thanks
    49
    Thanked 0 Times in 0 Posts

    Default

    Now why didn't I think of that? Problem solved. Thanks, folks.

    A.

Similar Threads

  1. css not centering
    By Yammaski in forum CSS
    Replies: 1
    Last Post: 12-11-2011, 06:14 PM
  2. Centering Nav. Bar.
    By Ron D in forum HTML
    Replies: 2
    Last Post: 02-01-2011, 02:06 AM
  3. centering css nav bar
    By nolanbuc in forum CSS
    Replies: 5
    Last Post: 07-02-2008, 11:06 AM
  4. Please help me with centering
    By nycguurl in forum JavaScript
    Replies: 2
    Last Post: 10-05-2007, 02:19 PM
  5. IE not centering...
    By trs in forum CSS
    Replies: 1
    Last Post: 07-20-2006, 05:44 AM

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
  •