Wrox Programmer Forums
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2005, 02:18 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 137
Thanks: 0
Thanked 0 Times in 0 Posts
Default CSS Float error


I have attempted my first table-less design on my home page
using div and CSS - using FLOAT for positioning!

The problem is that in some older browsers the positioning expands the height and the content doesnt render correctly.

Are there problems using FLOAT in IE?

The code is below



Gaz
__________________
Gaz
 
Old July 18th, 2005, 08:53 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I'm not seeing any problems on that page. Did you fix it?

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
 
Old July 18th, 2005, 09:08 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 137
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

If the site is viewed in FireFox or the latest version of IE then all is well.

The problem I been made aware of is when the site is viewed in older browsers like IE 5. I have ben informed that IE 5 has problems with Floats.

Basically what happens is the main content area - the right content encounters a display error - whereby the flash movie on the right aligns to the bottom and expands the content area height for that containing block.

The CSS used is as follows:
===========================

body {
background-image : url("images/bk-title.jpg");
background-repeat : repeat;
background-color : #000099;
font-family : "Lucida Grande", Verdana, Lucinda, Arial, Helvetcia, sans-serif;
font-size : 8pt;
color : #000000;
margin-top : 50px;
margin-left : 100px;
}
a:link {
color : #ffffff;
text-decoration : none;
}
a:visited {
color : #ffffff;
text-decoration : none;
}
a:hover {
color : #ffffff;
text-decoration : underline;
}
a:active {
color : #ffffff;
text-decoration : underline;
}
div {
width : 720px;
background-color : #ffffff;
padding : 6px;
}
div#logo {
height : 60px;
}
div#logo img {
float : left;
}
div#navlinks {
background-color : #009900;
height : 15px;
}
div#navlinks a {
padding-left : 10px;
padding-right : 10px;
}
div#content {
height : 350px;
}
div#webcontent {
height : 380px;
}
p#leftflash {
width : 390px;
float : left;
padding-top : 10px;
}
p#leftflash a {
color : #009900;
text-decoration : underline;
}
p#rightflash {
width : 330px;
float : right;
padding-top : 10px;
}
p#leftcontent {
width : 360px;
float : left;
}
img#grad1 {
margin-left : 220px;
}
img#grad2 {
margin-left : 110px;
}
img#grad3 {
margin-left : 60px;
}
img#poster {
margin-left : 80px;
}
img#phone {
margin-left : 30px;
}
img#computer {
margin-left : 30px;
}
img#review {
margin-left : 100px;
margin-top : 30px;
}
p#rightcontent {
width : 360px;
float : right;
}
p#rightcontent a {
color : #009900;
text-decoration : underline;
}
p#rightcontent a:hover {
background-color : #ffff00;
color : #000000;
}
form#formcontent {
width : 360px;
float : right;
}
strong {
color : #009900;
font-size : 10pt;
}
strong#heading {
color : #009900;
font-size : 16pt;
font-family : "Lucida Grande", "comic sans ms", Verdana, Lucinda, Arial, Helvetcia, sans-serif;
text-align : center;
}
strong#heading2 {
color : #009900;
width : 360px;
text-align : center;
font-size : 16pt;
font-family : "Lucida Grande", "comic sans ms", Verdana, Lucinda, Arial, Helvetcia, sans-serif;
}
strong#note {
color : #009900;
font-size : 8px;
}
div#copyright {
height : 15px;
background : #009900;
color : #ffffff;
text-align : center;
}

HTML for that page is:
======================

<!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=iso-8859-1" />
<title>Garry Butcher's Home Page | gazbutcher.co.uk | 1970's Retro Edition</title>
<meta name="description" content="gazbutcher.co.uk is a kind of online CV for Garry Butcher, a late twenty-something Computer Science graduate living in United Kingdom, somewhere in middle earth" />
<meta name="keywords" content="gazbutcher, garry butcher, gary butcher, computer science, web design, garry, gaz, gazbutcher.co.uk, CV, online CV, Computer Science, web, development" />
<link rel="stylesheet" href="gaz_style.css" type="text/css" />
<script language="javascript" type="text/javascript" src="preloads.js"></script>
</head>
<body onload="preLoad_Images();">
<div id="logo"><img src="images/gazbutcher-logo.jpg" alt="gazbutcher website logo" /></div>
<div id="navlinks">
<a href="index.html" target="_self">[ Welcome Page ]</a>
<a href="qual.html" target="_self">[ Qualifications ]</a>
<a href="tech.html" target="_self">[ Technical Skills ]</a>
<a href="weblinks.html" target="_self">[ Web Links ]</a>
<a href="otherinfo.html" target="_self">[ Additional Info. ]</a>
<a href="contact.html" target="_self">[ Contact Form ]</a>
</div>
<div id="content">
<p id="leftflash">
Garry Butcher was born in the late 1970's. Having had a keen interest in computing since his mother and
father bought him his first Computer, a Toshiba MSX 64K for Christmas, he started thinking about how he might pursue a career in the Computer games industry. However, after completing
his GCSE's and talking to the School careers adviser he decided to undertake studies in business and finance at a
local College.<br /><br />
Having topped the class in all the computer study aspects of the course, it was suggested by his computer
lecturer that he should perhaps pursue studies that best matched his ability and interests. On realising
his interest in computing could become a career he went on to complete a National Diploma in <a href="javascript:newWindow()">Computer Studies</a>
followed by decision to study a degree in Computer Science at a local University. Since then he hasn't looked back or stopped speaking in a third person.
<br /><br />You can find out more about Garry using links above<br /><br />
<a href="http://validator.w3.org/check/referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a>
<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.gazbutcher.co.uk/gaz_style.css"><img border="0" width="88" height="31" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>&nbsp;&nbsp;Last updated 19/05/2005
<br /><br />
<a href="http://www.feedvalidator.org/check.cgi?url=http://www.gazbutcher.co.uk/gazfeed.xml"><img src="images/valid-rss.gif" border="0" alt="[Valid RSS]" width="88" height="31" /></a>
<a href="gazfeed.xml"><img src="images/rssbut.gif" border="0" alt="RSS feed link" /></a>
</p>
<p id="rightflash">
<object type="application/x-shockwave-flash" data="acts.swf" width="280" height="220">
<param name="movie" value="acts.swf" />
<img src="noflash.gif" width="200" height="100" alt="" />
</object>
</p>
</div>
<div id="copyright">Site version 6.0 &copy; 2005 by GB &brvbar;&brvbar; Active ingredients <a href="http://validator.w3.org/check/referer" target="_blank">XHTML 1.0</a> and CSS</div>
</body>
</html>

Gaz
 
Old July 18th, 2005, 09:25 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I wouldn't worry about IE5, personally. It has less than 1% marketshare. I would, OTOH, bother with IE 5.5, since it still has a marginal number of users.

You can use Dean Edwards' IE7 http://dean.edwards.name/ie7. That's not the next version of Internet Explorer, but a collection of javascripts that brings CSS compatibility to Explorer 5, 5.5 and 6. You can also use some conditional comment style sheets to specifically target Explorer 5, and 5.5.

For example, if you wanted to provide CSS that only IE 5.5 can see, you do that in a conditional comment.
<!--[if IE 5.5]>
<link rel='stylesheet' href='ie55.css' media='all' />
<![endif]-->

More about conditional comments:
http://msdn.microsoft.com/workshop/a...omment_ovw.asp

You can also install multiple IEs on your computer, but you can't install the versions from Microsoft, you have to run some hacked copies. Obtain the hacked copies, and read all about that here:
http://www.quirksmode.org/index.html...ultipleie.html

Conditional comments are broken in these hacked copies of Explorer. The copies always say the version of Explorer is the version of Explorer you really have installed, so keep that in mind as you develop a solution.

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design





Similar Threads
Thread Thread Starter Forum Replies Last Post
Css Parse error manimoo CSS Cascading Style Sheets 1 October 14th, 2006 10:18 AM
CSS Parse Error DJB1954 CSS Cascading Style Sheets 6 August 18th, 2006 04:56 PM
DIV float / clear error? socoolbrewster CSS Cascading Style Sheets 2 June 3rd, 2006 04:27 PM
CSS Float Display Problem socoolbrewster CSS Cascading Style Sheets 12 October 20th, 2005 07:22 AM
Error converting data type varchar to float. Trojan_uk SQL Server ASP 5 April 27th, 2004 02:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.