Results 1 to 5 of 5

Thread: Why is image not completely on the left?

  1. #1
    Join Date
    Jan 2006
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Why is image not completely on the left?

    Hello,
    I have tried many times but do not understand why Image can not be completely on the left.

    there is line 329 in enclosed file:
    PHP Code:
    <td width="366"><img src="index_files/homepage_mainimage2.gif" width="366" height="303"></td
    Need this image completely on the left without small space as you can se if you open in IE. Strange that in Mozilla it works without problem.

    If I add sample text xyyxy in line 311 it will have white space between left menu (text xyyxy) and image homepage_mainimage2.gif

    I kindly aks you to send me what I have to change that it will work.
    Enclosed is complete file.
    Regards


    PHP Code:

        
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/html4/loose.dtd"
    >
    <
    html>
    <
    head>
    <
    title>Testing page</title>
    <
    meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <
    style type="text/css">

       * {
        
    margin:0;
        
    padding0;
    }


        
    #wrapper {
        
    width771px;
        
    margin0 auto;
        
    font-size80%;
        
    color#54628a;
        
    line-height1.5em;
        
    text-alignleft;
    }

        
    #header {
        
    border-bottom-width3px;
        
    border-bottom-stylesolid;
        
    border-bottom-color#FF9300;
        
    top36px;
        }


        
    #logo {
        
    background-repeatno-repeat;
        
    height56px;
        
    top0px;
        
    right0px;
        
    width120px;
    }

        
    #navbar {
        
    background-imageurl(index_files/index_bar.gif);
        
    background-repeatrepeat-x;
        
    height20px;
        
    width771px;
    }
        
    #midbar {
        
    width771px;
        
    top50px;
        
    background-repeatrepeat-x;
        
    background-imageurl(index_files/index_bar.gif);
        
    height17px;
    }

    #holderdiv {
        
    padding-right10px;
        
    padding-left10px;
        
    margin-right0px;
        
    width180px;
        
    background-color#FEEAB7;
    }

    .
    leftcoldiv {
        
    margin10px 0px;
        
    border1px solid #323c5a;
        
    background-color#FFFFFF;
        
    width100%;
    }

    .
    leftcoldivlight {
        
    margin10px 0px;
        
    border1px solid #323c5a;
        
    background-color#f5f7ff;
        
    width100%;
    }

     
    body {
        
    font-familyArialHelveticasans-serif;
        
    text-alignleft;
        
    font-size100%;
        
    padding-top20px;
        
    padding-bottom20px;
        
    background-imageurl(index_files/fondo2.GIF);
        
    background-positionleft;
        }

    {
    }


    .
    leftcoldiv p {
        
    margin5px 0;
        
    padding5;
        
    color#323c5a;
        
    font-size90%;
        
    line-height1.3em;
    }

    .
    leftcoldivlight p {
        
    margin5px 0;
        
    padding5;
        
    color#323c5a;
        
    font-size90%;
        
    line-height1.3em;
    }

    .
    leftcoldiv h2 {
        
    margin0;
        
    background-color#98a5cb;
        
    color#000000;
        
    font-size120%;
        
    padding1px 5px;
        
    border-bottom-width1px;
        
    border-bottom-stylesolid;
        
    border-bottom-color#323c5a;
        
    border-top-width1px;
        
    border-top-stylesolid;
        
    border-top-color#bec6df;
        
    font-familyArialHelveticasans-serif;
        
    font-weightbold;
    }

    .
    leftcoldiv h3 {
        
    margin0;
        
    background-color#ff9300;
        
    color#000000;
        
    font-size120%;
        
    padding1px 5px;
        
    border-bottom-width1px;
        
    border-bottom-stylesolid;
        
    border-bottom-color#323c5a;
        
    border-top-width1px;
        
    border-top-stylesolid;
        
    border-top-color#fec16f;
        
    font-familyArialHelveticasans-serif;
        
    font-weightbold;
    }
    .
    leftcoldivlight h4 {
        
    margin0;
        
    color#000000;
        
    font-size120%;
        
    padding1px 5px;
        
    border-bottom-width1px;
        
    border-bottom-stylesolid;
        
    border-bottom-color#323c5a;
        
    background-imageurl(index_files/index_h4bg.gif);
        
    background-repeatrepeat-x;
        
    border-top-width1px;
        
    border-top-stylesolid;
        
    border-top-color#f5f7ff;
        
    font-weightbold;
        
    font-familyArialHelveticasans-serif;
    }


    h1 {
        
    font-size130%;
        
    margin0px;
        
    color#000000;
        
    padding-top6px;
        
    padding-left10px;
        
    font-familyArialHelveticasans-serif;
    }
    h2 {
        
    font-size120%;
        
    color#000000;
        
    margin-top4px;
        
    margin-bottom2px;
    }

    ol {
        
    margin-top0px;
        
    margin-bottom0px;
        
    margin-left25px;
        
    color#54628a;
    }

     
    ul {
        
    margin-top0px;
        
    margin-bottom0px;
        
    color#54628a;
        
    font-size80%;
        
    font-weightnormal;
        list-
    style-typedisc;
        list-
    style-imageurl(index_files/index_bullet.gif);
    }

    a:link {
        
    color#ff9300;
    }
     
    a:visited {
        
    color#ff9300;
    }
     
    a:link:hover {
        
    color#ffffff;
    }

    .
    divider {
        
    border-top-width1px;
        
    border-top-stylesolid;
        
    border-top-color#54628a;
    }

        .
    left {
        
    floatleft;
    }

       .
    right {
        
    floatright;
    }

    .
    footer {
        
    font-size75%;
        
    border-top-width2px;
        
    border-top-stylesolid;
        
    border-top-color#ff9300;
        
    background-imageurl(index_files/index_bar.gif);
        
    background-repeatrepeat-x;
        
    width771px;
        
    text-aligncenter;
        
    padding-top4px;
        
    padding-bottom8px;
        
    color#FEEAB7;
        
    border-right-width1px;
        
    border-left-width1px;
        
    border-right-stylesolid;
        
    border-left-stylesolid;
        
    border-right-color#98a5cb;
        
    border-left-color#98a5cb;
        
    border-bottom-width1px;
        
    border-bottom-stylesolid;
        
    border-bottom-color#54628a;
    }


    #rightcoldiv {
        
    background-color#FFFFFF;
        
    margin-top0px;
        
    margin-right0px;
        
    margin-bottom0px;
        
    margin-left200px;
        
    padding-bottom10px;
        
    padding-top10px;
    }


    .
    coldiv2
    {  
        
    background-color:#FFFFFF;
        
    border-top1px solid #E6D3A8;
        
    color#000000;
        
    border-bottom-width1px;
        
    border-bottom-stylesolid;
        
    border-bottom-color#E6D3A8;
        
    background-positiontop;
    }

    }

    .
    coldiv h1{
        
    margin8px 0 10px;
        
    background-color#faf9f5;/*themecolour3;*/
        
    border-top1px solid #E6D3A8;
        
    border-bottom1px solid #E6D3A8;
        
    padding1px 0px 3px 0px;
        
    color#000000;
    }

    .
    style1 {
        
    vertical-align:top;
        
    font-size14px;
        
    font-weightbold;
        
    color#D26200;
    }




    -->
    </
    style>


    </
    head>

    <
    body leftmargin="0" topmargin="0" border=1>

    <
    div id="wrapper">





      <
    div id="header"><table width="770" border="0" cellpadding="0" cellspacing="0">
      <
    tr>
        <
    td valign="top"><div align="right"><img src="index_files/Banner_772_px.jpg" /></td>
        <
    td valign="top"><div align="left"><img src="index_files/Banner772_pxlogo.jpg"  width="297" height="113"/></td>
      </
    tr>
    </
    table>
    </
    div>



      <
    div id="midbar">
        <
    div align="center" >
        </
    div>
      </
    div>

      <
    div class="left" id="holderdiv">


      
    xyyxy


      
    <div>





        </
    div>

      </
    div>
      <!--
    start of right-hand column content-->

     <
    div id="rightcoldiv">
     <
    div class="coldiv2">  
     <
    table width="566" height="39" cellpadding="5" cellspacing="0">
         <
    tr>
           <
    td width="366"><img src="index_files/homepage_mainimage2.gif" width="366" height="303"></td>
           <
    td width="198"><table width="195" height="298">
             <
    tr>
               <
    td width="10" height="298">&nbsp;</td>
               <
    td width="160" valign="top"><class="style1">Welcome</p>
                 <
    p></p>

                 <
    p>&nbsp;</p>
                 <
    p>&nbsp;</p>
                 <
    p>&nbsp;</p>
                 <
    p>&nbsp;</p>
            </
    td>
               <
    td width="9">&nbsp;</td>
             </
    tr>
           </
    table></td>
         </
    tr>

       </
    table>
       </
    div>

       
     </
    div>

     <!--        -->




      <
    div style="clear: both;"></div>

     <
    div class="footer">
     <
    span></span>
     </
    div>

    </
    div>





    </
    body>
    </
    html

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    It's definitely an IE rendering flaw... I can't see what's wrong, but I wouldn't recommend tables for your layout. Use float:left; and corresponding widths for divs to create columns.
    Example:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>3 column layout</title>
    <style type="text/css">
    .left {
    height:400px;
    border:1px solid black;
    float:left;
    width:25&#37;;
    }
    .middle {
    height:400px;
    border:1px solid black;
    float:left;
    width:50%;
    }
    .right {
    height:400px;
    border:1px solid black;
    float:left;
    width:25%;
    }
    </style>
    </head>
    <body>
    <div class="left">
    	test 123
    </div>
    
    <div class="middle">
    	test 123
    </div>
    
    <div class="right">
    	test 123
    </div>
    </body>
    </html>
    - Mike

  3. #3
    Join Date
    Jan 2006
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    thank you for suggestion. it works now. Just have small question:
    If tehre is
    .middle {
    margin-top: 10px;
    width:571px;
    float:left;
    background-color: #FFFFFF;

    }
    How can I do background in area where is margin-top: 10px; like background-color: #FFFFFF;
    Last edited by toplisek; 04-05-2007 at 02:52 PM.

  4. #4
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    if you are talking about having some whitespace above your content, then you do not use margin, you should use

    Code:
    padding-top: 10px;

  5. #5
    Join Date
    Jan 2006
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello,
    thank you very much.I have found this (your) solution after 10 minutes.
    Regards

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
  •