Welcome to WebDesignForums.net!
You're currently viewing WDF as a guest. By registering for a free account, you'll be able to participate with other members in our friendly community. Being a member allows you to ask questions and get answers for those troublesome web development tasks!

In addition, as a member you'll be able to post your websites up for review. Using our unique website review system you can gain some amazing feedback from some of the best web developers around. This is a completely free service to all registered members.

Ready to register yet? Registration is 100% free. Click Here To Join Now!

HTML Tidy screwed up my centering, and I can't figure out how to fix it

Discussion in 'HTML and CSS Help' started by Frumpy Jones, Jul 14, 2012.

  1. Offline

    Frumpy Jones New Member

    Message Count:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    I have a project due. And the last step before any project is to validate the sucka at validator.w3c,org. Sure enough problems (As I am a n00b). I used HTML-Tidy to offer suggestive fixes and sure enough it did, and everything still works right EXCEPT my page is no longer centered to the window. I have no idea how to fix this, as trying a simple <div align="center"> (Which I first had and worked beautifully) now no longer does the tirck, or onlly applies it to certain areas.

    So I need your bigger-brains-than-mine help.

    Here's a link to the site as it is now all HTML-Tidy'ed up:

    www.happyhappyfaces.com/atomic/index.html

    Thanks in advance for suggestions on how to fix this...


  2. Offline

    TheGAME1264 The Displaced Web Redneck Moderator

    Message Count:
    9,381
    Likes Received:
    1,243
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Not from USA
    Code:
    <body>
    <div style="margin:  0px auto;  width:  1024px;">
    ...all your other stuff...
    </div>
    </body>
    
    How picky is your teacher going to be about code, though? If (s)he sees the ImageReady slices, will that affect your grade?


  3. Offline

    Frumpy Jones New Member

    Message Count:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Slices, no. Code validation, yes (I think slicing gets a bad rap...). Other parts involved NOT slicing, but I'n hitting the major components in this one. Just don't like my website all nudged into the upper left.

    That said I tried your code and it removed my entire background image and colors...

    **EDIT** I then moved it underneath the background image parts, and it just keeps moving ONLY the background around (Centered), the rest of my site is wedged nicely in the upper left of the window.. :(


  4. Offline

    Ronald Roe Well-Known Member

    Message Count:
    1,121
    Likes Received:
    281
    Trophy Points:
    83
    Gender:
    Male
    Location:
    Oklahoma City/Norman/Midwest City
    This is why no one likes slicing. It's not a bad rap, it's bad practice. I can't see your site because of the network I'm on right now, but I'm going to go ahead and take a shot in the dark and say your slices are likely absolutely positioned. They are positioned based on the top left corner of the first relatively positioned parent, in this case the <body> tag. So, they're ignoring what would have otherwise been a perfectly good fix provided by TheGAME.


  5. Offline

    Frumpy Jones New Member

    Message Count:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    I wouldn't doubt that. But that said, It worked perfectly as far as centering BEFORE HTML-Tidy. So it CAN work. I just have no idea what TIDY did to it to make it NOT WORK... I can post both the before and after code here, but not sure if that's permissible...


  6. Offline

    TheGAME1264 The Displaced Web Redneck Moderator

    Message Count:
    9,381
    Likes Received:
    1,243
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Not from USA
    Table-based code, actually.


  7. Offline

    TheGAME1264 The Displaced Web Redneck Moderator

    Message Count:
    9,381
    Likes Received:
    1,243
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Not from USA
    That code should work. It usually only fails because something else is invalid or causing a problem.

    Save a copy of your index page, then strip it down to almost nothing and see if that works (as in my tag). Then add pieces in until it no longer does, and you'll have your problem. I'd help you find it, but my wife and daughter apparently have a desire to go shopping rather than take naps.


  8. Offline

    Noteleklabs Active Member

    Message Count:
    173
    Likes Received:
    27
    Trophy Points:
    28
    Gender:
    Male
    Location:
    NC
    is it the whole page, or just the text? if its the text then do text-align. is there anything in the code that would set it to the left? I can't really tell you the problem unless you show us code.


  9. Offline

    TheGAME1264 The Displaced Web Redneck Moderator

    Message Count:
    9,381
    Likes Received:
    1,243
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Not from USA
    I looked at it a little more closely, and I don't see where you've implemented my suggestion. Put it in, upload it, and let's see it.


  10. Offline

    Frumpy Jones New Member

    Message Count:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    I figured it out, and your code worked. I took you literally about where to put the code, and it erased the background image, so I placed it right under the background image but it didn't do anything.. After a day away, my fresh set of eyes noticed I put the code you gave me INSIDE a style that closed. I made sure that it was all by itself (And after the Background image properties and it worked like a champ!

    THANK YOU SOO MUCH!:dance::showoff::cloud9::bounce:


  11. Offline

    TheGAME1264 The Displaced Web Redneck Moderator

    Message Count:
    9,381
    Likes Received:
    1,243
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Not from USA
    You're welcome...and that will happen. If you haven't gotten pissed off by something, looked away from it, and looked back at it and solved it, you're not a real code warrior.


  12. Offline

    Noteleklabs Active Member

    Message Count:
    173
    Likes Received:
    27
    Trophy Points:
    28
    Gender:
    Male
    Location:
    NC
    don't you just love how your brain just stops working about 8 hours into the day!

    #ineedcoffee


Share This Page