Results 1 to 7 of 7

Thread: ? Autosize/Center Aligning Website for Different Browser Sizes

  1. #1
    Join Date
    May 2008
    Location
    Miami, Fl
    Posts
    4
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Exclamation ? Autosize/Center Aligning Website for Different Browser Sizes

    I am having issues creating a website (using imageready) that is centered in all browsers.

    I made table width & height = 100% and made align & valign = center so that it would center in the middle of any viewers browser page-not sure I did this correctly...

    I also have an link to a pdf file that may download for the viewer if they so choose, but something weird is happening around that link - white spaces as if the page is broken up.

    the site is - URL REMOVED PER USER REQUEST

    I'm sure this is a simple problem, but I am quite inexperienced so any help is greatly appreciated.

    HTML Code:
    <html>
    <head>
    <title>Kids-First-Tutoring-Center</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <!-- ImageReady Slices (Kids-First-Tutoring-Center.jpg) -->
    <table id="Table_01" width="100%" height="100%" align="center" valign="center" border="0" cellpadding="0" cellspacing="0">
    	<tr>
    		<td colspan="3">
    			<img src="images/index_01.jpg" width="1280" height="410" alt=""></td>
    	</tr>
    
    	<tr>
    		<td rowspan="2">
    			<img src="images/index_02.jpg" width="80" height="614" alt=""></td>
    		<td>
    			<a href="Kids1st-Summer-Registration.pdf" target="_blank"><img src="index_03.jpg" alt="Summer_Registration_Form" /></a></td>
    		<td rowspan="2">
    			<img src="images/index_04.jpg" width="831" height="614" alt=""></td>
    	</tr>
    	<tr>
    
    		<td>
    			<img src="images/index_05.jpg" width="369" height="527" alt=""></td>
    	</tr>
    </table>
    <!-- End ImageReady Slices -->
    </body>
    </html>
    Last edited by thetestingsite; 06-19-2009 at 01:59 PM. Reason: clarify issue

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    A little CSS can go a long way.

    Add the following between your <head> tags.
    Code:
    <style type="text/css">
    	table {
    		margin:0 auto;
    	}
    </style>
    By the way, tables were not designed to be used for layout and it is generally recommened not to do so. You should be using CSS for this.

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

    FutureRoots (05-17-2008)

  4. #3
    Join Date
    May 2008
    Location
    Miami, Fl
    Posts
    4
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    thanks, i tried this and it still looks the same.

  5. #4
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    I wonder why Medyman gives you that margin:auto;, maybe he'll explain later.

    Anyway, the issue is not more of a CSS issue but an image width and height issue

    See if this code helps:
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
    <html><head><title>Kids-First-Tutoring-Center</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    *{margin:0;padding:0;}
    body{background:#fff;}
    img{display:block;}
    #wrap{width:1280px;}
    #nav{width:373px;float:left;}
    </style>
    </head>
    <body>
    <div id="wrap">
    <img src="images/index_01.jpg" alt="" style="height:410px;width:1280px;">
    <img src="images/index_02.jpg" alt="" style="height:617px;width:80px;float:left;">
    
    <div id="nav">
    <a href="http://www.kidsfirsttutoringcenter.com/Kids1st-Summer-Registration.pdf" target="_blank"><img src="images/index_03.jpg" alt="Summer_Registration_Form"></a>
    <img src="images/index_05.jpg" alt="" style="width:373px;height:523px;float:left;">
    </div>
    <img src="images/index_04.jpg" alt="" style="width:827px;height:618px;float:right;">
    </div>
    </body>
    </html>
    P.S. I've change your code away from the deprecated attributes
    I modified your code because tables was'nt intended for layouts

    I also added a DTD in your page for it to validate


    Hope that helps
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  6. The Following User Says Thank You to rangana For This Useful Post:

    FutureRoots (05-17-2008)

  7. #5
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    I wonder why Medyman gives you that margin:auto;, maybe he'll explain later.
    Sorry, I misunderstood the issue.

    What Rangana suggests should work

  8. #6
    Join Date
    May 2008
    Location
    Miami, Fl
    Posts
    4
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Talking genius! you are awesome.

    thanks a million! you sure know your stuff. i am going to read up more on why the original code was not working. thank-you for the info...really & truly

  9. #7
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    In your original code, both the height and width makes it annoying

    ...This article should also help you explain why there are gaps:
    http://developer.mozilla.org/en/docs...ysterious_Gaps
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

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
  •