School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,099 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,028 people online right now. Registration is fast and FREE... Join Now!




Width Error in IE 7

 

Width Error in IE 7

phzeroltd

23 Oct, 2009 - 06:07 AM
Post #1

New D.I.C Head
*

Joined: 19 Oct, 2009
Posts: 15


My Contributions
Hi there,

I have been writing something in HTML and found a strange error. In IE8 and FF the page shows fine, but in IE7 it pulls the text in closer than the opening of the frame, even though the width is set to 100%. Please see some example code below:

CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>

</title>
    <style type="text/css">
        .style1
        {
            width: 580px;
        }
        .style2
        {
            color: #0069BF;
            font-family: Arial, Helvetica, sans-serif;
            font-size: small;
            height: 17px;
        }
        .style3
        {
            color: #666666;
            font-family: Arial, Helvetica, sans-serif;
            font-size: small;
        }
    </style>
</head>
<body>
    <form name="form1" method="post" action="mainnewssummary.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNDk4NjE1MTk0ZGSvlK3DnBHuweYMwEpWVyljvH0zZg==" />
</div>

    <div>
<tr>
            <td class="style2"><a href='./MainNews.aspx?SelectedID=6'><U>Andys Test</U></a></td>
            </tr>
             <tr>
                <td class="style3" width="222">did it work?...</td>
            </tr>
             <tr>
                <td class="style3">&nbsp;</td>
            </tr>
              
             <tr>
                <td class="style3">15/10/2009 11:59:45</td>
            </tr>
            <tr>
            <td class="style2"><a href='./MainNews.aspx?SelectedID=7'><U>Testing</U></a></td>
            </tr>
             <tr>
                <td class="style3" width="222">I am now testing the system as it has gone live for testing....</td>
            </tr>
             <tr>
                <td class="style3">&nbsp;</td>
            </tr>
              
               </table>
    
    </div>
    </form>
</body>
</html>


Can anyone see why this code is being displayed differently in IE7?

Mike

User is offlineProfile CardPM
+Quote Post


ecuscotty

RE: Width Error In IE 7

23 Oct, 2009 - 11:00 AM
Post #2

New D.I.C Head
*

Joined: 14 Oct, 2009
Posts: 40



Thanked: 5 times
My Contributions
Hello,

Looks like you forgot the opening <table> tag. IE7 might not be as forgiving as the other browsers you were testing in.

Best of luck.
User is offlineProfile CardPM
+Quote Post

phzeroltd

RE: Width Error In IE 7

26 Oct, 2009 - 01:56 AM
Post #3

New D.I.C Head
*

Joined: 19 Oct, 2009
Posts: 15


My Contributions
Sorry that's my fault. I copied out the code and missed the middle part of the document, which included opening the Body and opening the Table.

Myself and my colleague are stumped as to why this is happening only in IE7... :-s,

Anyone else have an idea?

M
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 12:09PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month