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 4 of 4
  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    1
    Member #
    23630
    Hi, I built this website for my school Plattsburg Public School and I realise that I've done the banner wrong but not sure how to fix it. Wc3 doesn't like topmargin, leftmargin etc but I can't get the corners of the banner to align any other way. Now that Explorer 8 is out it looks crappy.

    Here's my code, can anyone help me rewrite it so it passes a validator? I'm thinking I might have to redesign the whole banner.

    </head>
    <body background="./graphics/bg12.gif" topmargin="15" leftmargin="0" marginheight="15" marginwidth="0">
    <table align="center" width="850" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td><img src="./graphics/cnrtl.gif" width="10" height="10" alt="graphic" /></td>
    <td><img src="./graphics/topborder.gif" width="850" height="10" alt="graphic" /></td>
    <td><img src="./graphics/cnrtr.gif" width="10" height="10" alt="graphic" /></td>
    </tr>
    <tr>
    <td><img src="./graphics/lsideborder.gif" width="10" height="180" alt="graphic" /></td>
    <td><img src="./graphics/banner.jpg" width="850" height="180" alt="Banner" /></td>
    <td><img src="./graphics/rsideborder.gif" width="10" height="180" alt="graphic" /></td>
    </tr>
    <tr>
    <td><img src="./graphics/cnrl1.gif" width="10" height="25" alt="graphic" /></td>
    <td><script type="text/javascript" src="./menu.js"></script>
    <td><img src="./graphics/cnrr1.gif" width="10" height="25" alt="graphic" /></td>
    </tr>

  2.  

  3. #2
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    I really think you need to consider getting away from tables and into divs, using an external CSS to position your elements.

    I hvae looked a the site in IE7 (looks OK) and in Firefox 3.6.9 (images don't line up). and I have to say you may have to just bite the bullet and redo things.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  4. #3
    Junior Member zeroality's Avatar
    Join Date
    Jul 2006
    Posts
    14
    Member #
    13486
    I agree, you really need to learn how to structure websites using CSS and all style elements (margin, background, etc) should be done in CSS as well.

    HTML and CSS Tutorials, References, and Articles | HTML Dog can get you started, and they have tutorials in stages so you can start from the beginning or jump ahead.

  5. #4
    WDF Staff RickM's Avatar
    Join Date
    Jun 2010
    Posts
    593
    Member #
    2
    Liked
    16 times
    I have to agree with AlphaMare and zeroality. Using CSS will make this so much easier. The problem you'll find is that table's just arent flexible. Using div's will allow you much greater control of things.

    It doesnt have to be hard either.

    A simple central alignment of a div is like so: (note: it's best to store the CSS in its own css file but this is for demo purposes)

    Code:
    <style>
    #myDiv
    {
    	margin: 0px auto;
    	text-align:center;
    }
    </style>
    
    <div id="myDiv">This is in the center</div>
    Now, if you want multiple divs on the same line (so it ends up looking like a table row) you'll need to use floats.

    Another way is to use list elements. a <ul> list can be styled to be horizontal, and you could have a list that has 3 elements: 1 for the left border, 1 for content, 1 for the right border.

    Here's a few decent recommended reads regarding using divs and css:

    Getting your DIVs to behave like TABLEs - Snook.ca
    A List Apart: Articles: Practical CSS Layout Tips, Tricks, & Techniques
    Nuno Silva Blog Archive Divs instead of tables

    Hope this helps & good luck with the site!


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 11:05 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com