OutFront Forums
     Home    Register     Search      Help      Login    

Sponsors
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

 

IE problems

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets and Accessibility >> IE problems
Page: [1]
 
 
Bill C

 

Posts: 8
Joined: 8/14/2009
Status: offline

 
IE problems - 8/19/2009 11:37:35   
I am building a page and typically use FF. But I also check in IE.
I have discovered and am using the csshover.htc I learned about here.

THE PROBLEM:

My main <div> lines up OK in FF by using a "static" positioning and to align vertically a negative EM.

BUT in IE the main <div> appears at the top of the entire page blocking out the header. I tried adding a a hack for the IE but it doesn't work.

I would be grateful for anyone's help.

You can view what I have done at: http://www.bick-arb.org/sandbox

Thanks

Bill C
TexasWebDevelopers

 

Posts: 761
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: IE problems - 8/19/2009 12:09:20   
Hmmm--Tailslide is the CSS guru but I think that your CSS on line 54-56 of your CSS stylesheet should be on the page--not in the CSS stylesheet--I can't get the stylesheet to validate properly.
I've never seen a combination of DIV's and tables like this before. Tables are for tabular data, not layout. I don't believe you need to set the positioning for your main DIV as static.

I would try starting with a two-column elastic layout with header and footer like this:


<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}

/* Tips for Elastic layouts
1. Since the elastic layouts overall sizing is based on the user's default fonts size, they are more unpredictable. Used correctly, they are also more accessible for those that need larger fonts size since the line length remains proportionate.
2. Sizing of divs in this layout are based on the 100% font size in the body element. If you decrease the text size overall by using a font-size: 80% on the body element or the #container, remember that the entire layout will downsize proportionately. You may want to increase the widths of the various divs to compensate for this.
3. If font sizing is changed in differing amounts on each div instead of on the overall design (ie: #sidebar1 is given a 70% font size and #mainContent is given an 85% font size), this will proportionately change each of the divs overall size. You may want to adjust based on your final font sizing.
*/
.wrapper #container {
width: 46em; /* this width will create a container that will fit in an 800px browser window if text is left at browser default font sizes */
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
}
.wrapper #header {
background: #DDDDDD;
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
}
.wrapper #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}

/* Tips for sidebar1:
1. Be aware that if you set a font-size value on this div, the overall width of the div will be adjusted accordingly.
2. Since we are working in ems, it's best not to use padding on the sidebar itself. It will be added to the width for standards compliant browsers creating an unknown actual width.
3. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".wrapper #sidebar1 p" rule.
*/
.wrapper #sidebar1 {
float: left;
width: 12em; /* since this element is floated, a width must be given */
background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 0; /* top and bottom padding create visual space within this div */
}
.wrapper #sidebar1 h3, .wrapper #sidebar1 p {
margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
margin-right: 10px;
}

/* Tips for mainContent:
1. If you give this #mainContent div a font-size value different than the #sidebar1 div, the margins of the #mainContent div will be based on its font-size and the width of the #sidebar1 div will be based on its font-size. You may wish to adjust the values of these divs.
2. The space between the mainContent and sidebar1 is created with the left margin on the mainContent div. No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
3. To avoid float drop, you may need to test to determine the approximate maximum image/element size since this layout is based on the user's font sizing combined with the values you set. However, if the user has their browser font size set lower than normal, less space will be available in the #mainContent div than you may see on testing.
4. In the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs that may occur.
*/
.wrapper #mainContent {
margin: 0 1.5em 0 13em; /* the right margin can be given in ems or pixels. It creates the space down the right side of the page. */
}
.wrapper #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
.wrapper #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}

/* Miscellaneous classes for reuse */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
-->
</style><!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.wrapper #sidebar1 { padding-top: 30px; }
.wrapper #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]--></head>

<body class="wrapper">

<div id="container">
<div id="header">
<h1>Header</h1>
<!-- end #header --></div>
<div id="sidebar1">
<h3>sidebar1 Content</h3>
<p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the left side of the #mainContent div if the #mainContent div will always contain more content than the #sidebar1 div. </p>
<p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. </p>
<!-- end #sidebar1 --></div>
<div id="mainContent">
<h1> Main Content </h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. </p>
<p>Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id, libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p>
<h2>H2 level heading </h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
<!-- end #mainContent --></div>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
<div id="footer">
<p>Footer</p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>

_____________________________

:)

Follow us on TWITTER

(in reply to Bill C)
Bill C

 

Posts: 8
Joined: 8/14/2009
Status: offline

 
RE: IE problems - 8/19/2009 12:34:14   
Thanks. I'll give it a try.
Bill C

(in reply to TexasWebDevelopers)
Bill C

 

Posts: 8
Joined: 8/14/2009
Status: offline

 
RE: IE problems - 8/19/2009 15:13:04   
Thanks again.
It worked beautifully!

(in reply to Bill C)
TexasWebDevelopers

 

Posts: 761
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: IE problems - 8/19/2009 17:11:20   
A few tweaks---I would justify rather than center your main descriptive text. Centered text is OK for image captions and the like but it makes for a more diffficult reading experience when all of the text is centered. Now it's time to move your CSS styles to an external stylesheet.

_____________________________

:)

Follow us on TWITTER

(in reply to Bill C)
Tailslide

 

Posts: 6750
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: IE problems - 8/20/2009 1:43:12   
Unusally, I disagree about justifying text - it's not recommended for text on the web due to accessibility issues.

Justification is fine in print but on screen, with the variation of ways that different browsers deal with fonts you can easily end up with what's known as "Rivers of White" between the words which can make it very very hard to read especially for anyone with reading difficulties or dislexia.



_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to TexasWebDevelopers)
TexasWebDevelopers

 

Posts: 761
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: IE problems - 8/20/2009 10:08:18   
Great point! Thanks!

_____________________________

:)

Follow us on TWITTER

(in reply to Tailslide)
Bill C

 

Posts: 8
Joined: 8/14/2009
Status: offline

 
RE: IE problems - 8/21/2009 10:03:45   
Sorry to keep bothering you!

I started to move the CSS to an external stylesheet. I discovered I could move most of it and keep the page owrking. I ended up leaving a good portion in the page because when it was moved to the stylesheet, the page fell apart.

What am I missing? As a novice CSS'er I am learning but apparently not enough and not fast enough!!!

Sure could use your help on this www.bick-arb.org/sandbox

(in reply to Tailslide)
TexasWebDevelopers

 

Posts: 761
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: IE problems - 8/21/2009 10:38:03   
No bother.

OK--understand that ONLY styles should be in between the style tags:
("styles go here" is shorthand for all of your existing styles - no need to waste all that space by pasting them in here)

<style type="text/css">
<!--
styles go here
-->
</style>


Yours looks like this:

<style type="text/css">
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<!@@@@@@@@@@@@@@@@@@@@@@@@@@@ >
<!@@Site design by William Cornelius - Clinton, Iowa @@>
<!@@@@@@@@@@@@@@@@@@@@@@@@@@@ >
<!--
styles go here
-->
</style>


DELETE the link to the style sheet and your comments (in BOLD).

<style type="text/css">

<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<!@@@@@@@@@@@@@@@@@@@@@@@@@@@ >
<!@@Site design by William Cornelius - Clinton, Iowa @@>
<!@@@@@@@@@@@@@@@@@@@@@@@@@@@ >


<!--
styles go here
-->
</style>


Now, Take all of the styles MINUS the tags (just the stuff in BOLD - below) and copy and paste into a new COMPLETELY BLANK page and save it as "newstyles.css" .

<style type="text/css">
<!--

styles go here

-->
</style>


Then DELETE all of this from the main page.

<style type="text/css">
<!--
styles go here
-->
</style>


So, you now have a main page with no style tags or styles or links to a style sheet and one external style sheet named "newstyles.css" that contains the styles but NO tags. The "<!--[if IE]> " style hack should remain on the main page (and all of your other pages along with the link to the new stylesheet)

Add this link to the stylesheet (in bold) into your main page above the code like this:


<link href="newstyles.css" rel="stylesheet" type="text/css" media="screen">

<!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.wrapper #sidebar1 { padding-top: 30px; }
.wrapper #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->


< Message edited by TexasWebDevelopers -- 8/21/2009 11:00:23 >


_____________________________

:)

Follow us on TWITTER

(in reply to Bill C)
Bill C

 

Posts: 8
Joined: 8/14/2009
Status: offline

 
RE: IE problems - 8/21/2009 10:56:19   
Got it!

Thank you. It works now.

I hope I can continue and build new pages without similar problems. It is getting a little easier

(in reply to TexasWebDevelopers)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets and Accessibility >> IE problems
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts