/    Sign up×
Community /Pin to ProfileBookmark

Float problems

Hello

I am trying to sort my front page ‘contents’ section, which includes codes from 3rd party sites.

Initially I just tried it with absolute positioning and all worked seemed OK but I thought it would be better with floats … maybe a bad move on my part.

I want the layout like this

top left corner .. red ‘about us’ box
followed on left by .. green picture div
followed on left by .. black weather div

top right corner .. blue recycle widget div

It’s not finished yet, but see the code so far

[CODE]

<!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>
<title></title>

<meta http-equiv=”content-type”
content=”text/html;charset=utf-8″ />

<style type=”text/css”>

*{
margin:0px;
padding:0px;
}

body{
background-color:#efc77c;
}

#contents{
background-color:aqua;
border-top:2px solid black;
height:900px;
width:760px;
float:right;
}

#aboutus{
background-color:red;
width:500px;
height:150px;
float:left;
}

#picture{
width:450px;
height:350px;
background-color:lime;
float:left;
}

#widget{

background-color:blue;

width:190px;
height:565px;
float:right
}

#weather{
background-color:black;
height:202px;
width:330px;
padding-left:10px;
float:left;
}

</style>

</head>
<body>

<div id=”contents”>

<div id=”aboutus”>
About Us div
</div>

<div id=”widget”>
<!–
<object type=”application/x-shockwave-flash” data=”http://www.recyclenow.com/swf/recyclenow_08/SidebarWidget.swf” width=”170″ height=”545″>
<param name=”movie” value=”http://www.recyclenow.com/swf/recyclenow_08/SidebarWidget.swf”>
<param name=”allowscriptaccess” value=”always”>
<param name=”flashvars” value=”widgetBackgroundColor=ffffff”
–>
</div>

<div id=”picture”>
</div>

<div id=”weather”>

<a href=”http://www.netweather.tv/” target=”_blank”><img border=”0″ src=”http://www.netweather.tv/4web2/netweather4webi.pl?lat=;lon=;title=Newcastle;template=1″ alt=”Netweather” /></a>

</div>

</div>

</body>
</html>
[/CODE]

All works fine on Firefox
All works fine on Chrome

But IE 7 and Opera

All works fine, if the actual recycle code is commented out, leaving only the blue div box.

However if the code is included, the red and blue boxes are still in their correct places but the other two have vanished. No image box or weather box

HELP !!

Please ! ?

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@optimus203May 31.2010 — You forgot to close the <object> tag in the commented out section. Revise to:

<object type="application/x-shockwave-flash" data="http://www.recyclenow.com/swf/recyclenow_08/SidebarWidget.swf" width="170" height="545">

<param name="movie" value="http://www.recyclenow.com/swf/recyclenow_08/SidebarWidget.swf">

<param name="allowscriptaccess" value="always">

<param name="flashvars" value="widgetBackgroundColor=ffffff">

</object>
×

Success!

Help @Williebee spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...