Hours and hours of searching for: Why does IE7 do this?

This is a tiny little page but I have a tiny little brain and I can’t figure out how to make it display in IE7 (which is the IE that I have).

It’s okay (still needs final tweaks) in Firefox but in IE the text boxes won’t stack up into a single column. It’s like I need a carriage return between the first text box and the second one.

I don’t know how to insert a clip of the css here (tiny brain) and the average reader probably doesn’t want to have to crawl over it to get to the answers anyway, but it’s here:

http://ap23-images.s3.amazonaws.com/ie-style-girls.css

I know that there are some of you that will say I shouldn’t have a separate IE css if I were competent enough but I’m not.

With all humility and gratitude, may I ask would someone care to look at this and tell me what I did wrong?

Thanks

Boy named Pseu

We really need to see the html too. Could you make up a little test page with the html and css together so we can easily test this?

You can just post the code and click the little # symbol in the toolbar above the textarea to wrap the code in code tags.

Okay, thanks:

HTML:


<!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>per OP request</title>
			<meta http-equiv="Content-Type"
				content="text/html; charset=utf-8" />
			<meta name="description" content="A band playing pleasant Sixties-flavored rock and pop music -- with smart lyrics, if that's okay..." />
			
		<link href="style-girls.css" rel="stylesheet" type="text/css" />
		
		
		<!--[if IE]>
        <link rel="stylesheet" type="text/css" href="ie-style-girls.css" />
		<![endif]-->


</head>
	
<body>

	<div id="back-icon">
	<a href="http://www.sitepoint.com/forums/css-53/..\\index.html"> <img src="wayback_icon_w_arrow_70p.gif" alt= "This is the button to go back to the home page" border="0" />
	</a>
	</div>


	<div id="copy">
<p> Welcome to the Future!<br/>
Although I guess you could say that any time...<br/>
<br/>
We're moving and we're going to be disconnected for a little while,<br/>
but we have an EP about half done.  Would you like to hear it?<br/>
It's kind of songs about girls, or maybe for girls.  Girl songs.<br/>
It starts out loud, but it settles down pretty quickly.<br/>
<br/>
The next one will be about boys. <br/>
You'll want to brace yourself for that one.<br/>

<br/>
All the standard disclaimers and apologies apply -- <br/>
the mixes are real approximate and some of the notes are off and stuff.<br/>
But the group of people who will ever make it to this<br/> 
little teensy little web page is very small and special,<br/>
and we can share, can't we?
<br/>
<br/>
We like the program to have a beginning, a middle, and an end,<br/>
so the whole CD is really best, when it actually happens. <br/>  
But for now, here are some mp3 singles for you:<br/><br/>

<a href="lynnie.mp3">Lynnie</a><br/>
<a href="your.mp3">Your Star</a><br/>
<a href="watching.mp3">Watching Things</a><br/>
<a href="terr.mp3">Terry Sings</a><br/>
</p>
	</div>

	<div id="keyword_copy">
<p>
A little bit of info to help people find us:
</p>
<p>
We're a band that plays songs that you might call pop music or Sixties rock<br/> 
or something like that.  We have pretty good songs and we play as best as we can.
</p>
<p>
We're influenced by a lot of the records that end up on Nuggets compilations.<br/>
Especially the Nightcrawlers and the Merry-Go-Round.  We don't use 
fuzz-tones very much.<br/>
Sometimes people call that kind of music garage bands or Sixties punk 
(some of it is punky).<br/>
We will admit that our songs have stories of happiness and loneliness and redemption.<br/>
We hope that's okay.
<br/><br/>
If you don't have the Rhino Nuggets box, you need it.  Of course you need our record too. <br/>
Also the Monkees.  We <em>like</em> the Monkees.
<br/>
<br/>
.
</p>
	</div>


	

	<div id="mail-us">		
		<a href="mailto:per OP request"> <img src="gth_email_us.gif" height="20px" width="110px" border="none" alt="This is the button to link to email us"/>
		</a>
	</div>



</body>

</html>


CSS:
(H1 is not used on this page)


/*
ie-style-girls.css for the site
*/



body {
border: solid 4px orange;
background: #000 url(gth_web_red_rose_q85.jpg)
	center center fixed no-repeat;
-moz-background-size: cover;
background-size: cover;
}


p {	
font-family: Futura Bk BT, MS Sans Serif, Verdana, Trebuchet MS, Verdana, Helvetica, Ariel, sans-serif; 
color: #FFF8C6;
}

	
#back-icon {
position:static;
width:150px;
margin-top: 4%;
margin-left: 0;
border: 2px solid yellow;
}


#H1 {
	border: 1px solid yellow;
	/* border: 0; */
	float: right;
	/*clear: left;*/
	width: 80%;
	margin-top: 3%;
}




#copy {
	border: 3px solid white;
	/* border: 0; */
	width: 50%;
	float: left;
	clear: right;
	margin-top: 10%;
}

#keyword_copy {
	border: 3px solid aqua;
	width: 65%;
	clear: right;
	margin-top: 60%;
	margin-left: 0%;
	font-size: small;

}


#mail-us {
position:static;
	border:4px solid green;
	/* float: right; */
	/* clear: right; */
	margin-top: 15%;
	margin-left: 50%;	
	margin-right: 10%;
}



a:link {
	COLOR: #DAA520; /*Goldenrod*/
}
a:visited {
	COLOR: #CD853F; /*Peru*/
}
a:hover {
	COLOR: #FFD700; /*Gold*/
}
a:active {
	COLOR: #FF69B4; /*Hot Pink*/
}



Hi,

Moved to CSS forum :slight_smile:

We’d still need to see what’s in style-girls.css because the IE stylesheet will be merged with whatever other rules are seen before.

We need all the CSS to get a clear picture of what’s going on and using just the IE css file does not produce anything close the the picture you posted :slight_smile: It would be better if we had a real link to work with if you have this online somewhere.

As you suspected you should not be using a whole IE file anyway and only the differences need to be in the IE only file and you certainly would not want to give it to all versions of IE in one go as they don’t have the same bugs.

It is unlikely from the code posted that you need any specific css yet for IE and it would be more important to address your coding concepts as they are flawed at present.

You would rarely using percentage for vertical margins as they are based on the width of the element and therefore would not be much use as it means elements move dramatically when the viewport is resized.

You should use p elements for paragraphs and no breaks. Breaks are only used for breaking up lines as used in form controls, addresses or poems but not blocks of text which should be coded using p elements only. (However looking at your text it seems that it may be some sort of poem anyway and then breaks would be correct to split it up.)

Use appropriate heading tags for elements which are obviously headings.


    <p> Welcome to the Future!<br/>

That should be a heading tag at the appropriate level.

Do you have an example of what the page should look like?

You probably need a structure more like this rough example:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body, table{
    margin: 0;
    padding: 0;
    font-size: 100%;
} 
object, iframe,
h1, h2, h3, h4, h5, h6, p, 
dl, dt, dd, ol, ul, fieldset, 
form, legend, table, caption, th, td {
    margin: 0;
    padding: 0;
    border:none;
}
ol, ul {list-style: none;}
table {
    border-collapse: separate;
    border-spacing: 0;
}
caption, th, td {
    text-align: left;
    font-weight: normal;
    vertical-align:top;
}
a:link {color: #DAA520; /*Goldenrod*/}
a:visited {color: #CD853F; /*Peru*/}
a:hover {color: #FFD700; /*Gold*/}
a:active {color: #FF69B4; /*Hot Pink*/}
img, a img{border:none}
h1,h2,h3,h4,h5,h6,p,ul,ol{margin:0 0 .75em}
/* end reset styles */

body {
    background: #000 url(gth_web_red_rose_q85.jpg) center center fixed no-repeat;
    color:#fff;
    -moz-background-size: cover;
    background-size: cover;
    font-family:"Futura Bk BT", "MS Sans Serif", Verdana, "Trebuchet MS", Helvetica, Arial, sans-serif;
}
p {color: #FFF8C6;}
p#back-icon{
    width:150px;
    margin:20px  0 10px;
    border: 2px solid yellow;
}
#wrapper{
    max-width:1200px;
    min-width:600px;
    margin :auto;
    border: solid 4px orange;
    padding:10px;
    zoom:1.0;
}
#main{
    border: 3px solid white;
    width: 50%;
    margin:25px auto;
    padding:10px;
}
#keyword_copy {
    border: 3px solid aqua;
    width: 65%;
    margin:50px auto;
    font-size: 92%;
    padding:10px;
}
#mail-us {
    border:4px solid green;
    text-align:center;
}


</style>
</head>
<body>
<div id="wrapper">
    <p id="back-icon"><a href="http://www.sitepoint.com/forums/css-53/..\\index.html"><img src="wayback_icon_w_arrow_70p.gif" alt= "per OP request" /></a></p>
    <div id="main">
        <h1>Welcome to the Future!</h1>
        <p>Although I guess you could say that any time...</p>
        <p>We're moving and we're going to be disconnected for a little while,     but we have an EP about half done.  Would you like to hear it?     It's kind of songs about girls, or maybe for girls.  Girl songs.     It starts out loud, but it settles down pretty quickly.</p>
        <p>The next one will be about boys.    You'll want to brace yourself for that one.</p>
        <p> All the standard disclaimers and apologies apply -- the mixes are real approximate and some of the notes are off and stuff. But the group of people who will ever make it to this little teensy little web page is very small and special, and we can share, can't we? </p>
        <p>We like the program to have a beginning, a middle, and an end, so the whole CD is really best, when it actually happens.          But for now, here are some mp3 singles for you:</p>
        <ul>
            <li><a href="lynnie.mp3">Lynnie</a></li>
            <li><a href="your.mp3">Your Star</a></li>
            <li><a href="watching.mp3">Watching Things</a></li>
            <li><a href="terry.mp3">Terry Sings</a></li>
        </ul>
    </div>
    <div id="keyword_copy">
        <p> A little bit of info to help people find us: </p>
        <p> We're a band that plays songs that you might call pop music or Sixties rock
            or something like that.  We have pretty good songs and we play as best as we can. </p>
        <p> We're influenced by a lot of the records that end up on Nuggets compilations.    Especially the Nightcrawlers and the Merry-Go-Round.  We don't use fuzz-tones very much. Sometimes people call that kind of music garage bands or Sixties punk 
            (some of it is punky).     We will admit that our songs have stories of happiness and loneliness and redemption. We hope that's okay.</p>
        <p> If you don't have the Rhino Nuggets box, you need it.  Of course you need our record too. Also the Monkees.  We <em>like</em> the Monkees. </p>
    </div>
    <p id="mail-us"><a href="mailto:per OP request"><img src="gth_email_us.gif" height="20px" width="110px" alt="This is the button to link to email us"/></a></p>
</div>
</body>
</html>


If you can show us what it should look like then we may be able to address your issues more specifically :slight_smile:

Thank you for your kind response!!

I was able to stash the files here:
<snip/>per OP request

Are you saying that any IE-specific css only needs to carry the differences between that and the regular css file? I’ve looked at hundreds of pages of css instruction and I’ve never seen anyone say that…more evidence that web composition is only for magicians.

Re width spec: Okay, thanks.

As for the p’s and br’s, I am extremely committed to deliberate location of line breaks. I want each line to express its own thought. If this breaks down when someone’s screen is too small, well, their screen is too small.

The page doesn’t have a heading because it’s a second page of the site. I have a logo heading but it clutters the page, so I’m running without. The back button will go to a new front page, but today in this unpublished page it will go to the old site.

Here’s what I set it up to look like, rendered in Firefox:

I couldn’t even say that I have any concepts; I’m just trying stuff that people tell me to do and seeing what happens. This is all way over my head. It would be great to find some comprehensive source of information on doing a simple page.

Forgive me for wanting what I want, but I do. :stuck_out_tongue:

MP

PS Hope the girls like the songs, if you have any girls there…

Yes.

If this breaks down when someone’s screen is too small, well, their screen is too small.

Just bear in mind the prediction of pundits that, within a few years, desktop computers will be a niche market, the majority of web browsing happening through mobile devices.

[ot]

More’s the pity, since people will be getting an impoverished viewing experience. If all you’re looking for is directions to the nearest Chinese restaurant, no problem, but if someone’s got a site dedicated to displaying his artwork, a tiny screen is simply a tiny screen, and it’s always going to be inferior.

By way of analogy, my nephew and his wife do all of their music listening with MP3s, heard through little earbuds. The signal is compressed to death (compared to a CD), and no earbuds can compete with real speakers.[/ot]

[ot]

Well, you could just as easily argue that viewing art on any digital device is an impoverished experience, compared with viewing the works in a gallery. Or listening to music with larger speakers compared with hearing a live performance. The whole digital age is an impoverished experience.

If the web is going mobile, you just have to deal with that.[/ot]

[ot]

Oh, no. I’m not leaving the house. ;)[/ot]

[ot]

Isn’t the main point of technology that you don’t have to leave the house any more? :lol:[/ot]

I think that the numbers show that to be the case now. But all you have to do is look at MySpace or even Facebook to realize that the young groovy a-go-go people nowadays are not very quality-of-experience driven. It’s their world and they’re welcome to it. I had my time. I have no inclination to buy all that portable junk to test my site that nobody goes to anyway.

By the way, I deleted the IE reference in my HTML and set Paul’s CSS in place. It didn’t work. The second text box is now level with the first one – but still on the right side of the screen. I admit I added line spaces between the sections to help me read and understand it but I don’t think I broke it doing that, did I?

Hi,

You don’t need any of those IE styles apart from one hack for IE6 as it doesn’t min-width.

You do need a change of tack though because only very modern browsers understand the background-cover property so you will need to instead center the page so that it stays over the image for those browsers that don’t support it.

As I said before avoid vertical percentage margins as they are based on the width of the element and scale awkwardly when the page is resized.

This is how I would go about setting the page up.


<!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>per OP request</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="A band playing pleasant Sixties-flavored rock and pop music -- with smart lyrics, if that's okay..." />
<link href="style-girls.css" rel="stylesheet" type="text/css" />
<style type="text/css">
/*
style-girls.css for the site
*/
html, body, table {
    margin: 0;
    padding: 0;
    font-size: 100%;
}
object, iframe, h1, h2, h3, h4, h5, h6, p, dl, dt, dd, ol, ul, fieldset, form, legend, table, caption, th, td {
    margin: 0;
    padding: 0;
    border:none;
}
ol, ul {
    list-style: none;
}
table {
    border-collapse: separate;
    border-spacing: 0;
}
caption, th, td {
    text-align: left;
    font-weight: normal;
    vertical-align:top;
}
a:link {color: #DAA520; /*Goldenrod*/}
a:visited {color: #CD853F; /*Peru*/}
a:hover {color: #FFD700; /*Gold*/}
a:active {color: #FF69B4; /*Hot Pink*/}
img, a img {border:none}
h1, h2, h3, h4, h5, h6, p, ul, ol {
    margin:0 0 .75em
}
p {
    color: #FFF8C6;
    font-weight: bold;
    margin:0 0 1.5em;
}
/* end reset styles */
html, body {
    min-width:600px;
}
body {
    background: #000 url(gth_web_red_rose_q85.jpg) center center fixed no-repeat;
    -moz-background-size: cover;
    background-size: cover;
    font-family: "Futura Bk BT", "MS Sans Serif", Verdana, "Trebuchet MS", Verdana, Helvetica, Ariel, sans-serif;
}
#wrapper {
    max-width:900px;
    min-width:600px;
    margin :auto;
    padding:10px 10px 30px;
    zoom:1.0;
}
* html #wrapper {
    width:900px;
}
#back-icon {
    width:150px;
    margin:50px 0 30px;
}
#H1 {
    border: 1px solid yellow;
    border: none;
    float: right;
    width: 80%;
    margin-top: 3%;
}
#copy {
    clear: right;
    margin-top: 25px;
}
#keyword_copy {
    clear: both;
    margin-top: 50px;
    font-size: small;
    width:100%;
}
#mail-us {
    float: right;
    margin:50px 0 0;
}
.cd {
    margin:10px 0;
    padding:0;
    list-style:none;
}
</style>
</head>
<body>
<div id="wrapper">
    <div id="back-icon"><a href="http://www.sitepoint.com/forums/css-53/css-53/..\\index.html"><img src="wayback_icon_w_arrow_70p.gif" alt= "Go back to the home page"/></a></div>
    <div id="copy">
        <p> Welcome to the Future!<br/>
            Although I guess you could say that any time...</p>
        <p>We're moving and we're going to be disconnected for a little while,<br/>
            but we have an EP about half done.  Would you like to hear it?<br/>
            It's kind of songs about girls, or maybe for girls.  Girl songs.<br/>
            It starts out loud, but it settles down pretty quickly.</p>
        <p>The next one will be about boys. <br/>
            You'll want to brace yourself for that one.</p>
        <p>All the standard disclaimers and apologies apply -- <br/>
            the mixes are real approximate and some of the notes are off and stuff.<br/>
            But the group of people who will ever make it to this<br/>
            little teensy little web page is very small and special,<br/>
            and we can share, can't we? </p>
        <p>We like the program to have a beginning, a middle, and an end,<br/>
            so the whole CD is really best, when it actually happens. <br/>
            But for now, here are some mp3 singles for you:</p>
        <div id="mail-us"><a href="mailto:per OP request"><img src="exp02-girls/gth_email_us.gif" height="20px" width="110px" alt="Email us"/></a></div>
        <ul class="cd">
            <li><a href="lynnie.mp3">Lynnie</a></li>
            <li><a href="your.mp3">Your Star</a></li>
            <li><a href="watching.mp3">Watching Things</a></li>
            <li><a href="terry.mp3">Terry Sings</a></li>
        </ul>
    </div>
    <div id="keyword_copy">
        <p> A little bit of info to help people find us: </p>
        <p> We're a band that plays songs that you might call pop music or Sixties rock<br/>
            or something like that.  We have pretty good songs and we play as best as we can.</p>
        <p> We're influenced by a lot of the records that end up on Nuggets compilations.<br/>
            Especially the Nightcrawlers and the Merry-Go-Round.  We don't use 
            fuzz-tones very much.<br/>
            Sometimes people call that kind of music garage bands or Sixties punk 
            (some of it is punky).<br/>
            We will admit that our songs have stories of happiness and loneliness and redemption.<br/>
            We hope that's okay.</p>
        <p>If you don't have the Rhino Nuggets box, you need it.  Of course you need our record too. <br/>
            Also the Monkees.  We <em>like</em> the Monkees.</p>
    </div>
</div>
</body>
</html>

Note that your image has a white border half way down the sides which looks odd so either remove it or add a full white line to each side.

Wow, seems to work, thanks!

Of course I need to slide things back and forth to make it pretty…

I’d love to know what made the second text box drop under the first but maybe it’s just magic.

“As I said before avoid vertical percentage margins as they are based on the width of the element and scale awkwardly when the page is resized.”

I would have thought that that’s the best way – if you state pixels, you’re nailed to one pixel number for every screen size and that can’t be good.

I knew about the image issues but that’s down the list after getting the boxes in the right places. I could see just having a larger image size for IE (there, I said it…:D). For pre-“cover” browsers, I dunno, do people just make it too big and then tell the browser to make it 100% width or something? Sites have always had background images, haven’t they? I mean since DOS?

Embarassingly grateful,

P

You were floating loads of things that didn’t need to be floated and you had percentage margins that didn’t make a lot of sense and were over constrained.

CSS is easy if you are logical and methodical.

Don’t micromanage every detail. For instance use a wrapper for the page to contain all the elements and then you don’t have to position all the individual elements. Just let content flow from one to the next logically.

“As I said before avoid vertical percentage margins as they are based on the width of the element and scale awkwardly when the page is resized.”

I would have thought that that’s the best way – if you state pixels, you’re nailed to one pixel number for every screen size and that can’t be good.

As far as width is concerned then percentage is fine (except that IE6 is a litttle buggy with it) but percentages on vertical margins is pointless because even the vertical percentage is based on the width of the containing block and not the height. If you increase the height of the browser the vertical margins do not change. However if you open the window wide suddenly all your content moves vertically which is certainly not what you want as it could eventually spread out too far.

As far as percentage width goes then as I said above you define that once with the page wrapper and then you don’t need to do it again. usually you combine this with a min and max width so that the page doesn’t become too big or too small that it breaks.

I knew about the image issues but that’s down the list after getting the boxes in the right places. I could see just having a larger image size for IE (there, I said it…:D). For pre-“cover” browsers, I dunno, do people just make it too big and then tell the browser to make it 100% width or something? Sites have always had background images, haven’t they? I mean since DOS?

No, no one used to have full page images at all (well not many anyway). It’s mainly a new concept due to faster connection speeds and faster browsers but a lot of developers still think its a bad idea.

Your background image for example is 65k which is probably more than a lot of whole sites that I design. You can get away with it these days with faster connections but it is still true that every byte counts.

Previously to get a full screen effect the approach would normally be to fade the images out at the edges to a solid color in your paint package and then you could just have the image centred and then the normal background colour taking over at the edges.

To be honest I prefer the display in IE with the fixed width non resizing centred image. I find these scaled images disconcerting lol but then I am old fashioned :slight_smile:

Paul,

Just popping in to say thank you.

Of course what you gave me worked, and of course I went in and moved some things around to suit my eye, but I was marooned and you saved me.

P