/    Sign up×
Community /Pin to ProfileBookmark

Css Layering issues.

Hello all, this is my first experiment with CSS layering to clone a table-based layout, and I’m having some cross-browser differences in rendering. At this point, I’m fairly certain my code is to blame, but I’m not sure of the best way to fix it.

As you can see from the [URL=http://develop.indriani.net/~andy/test/layer/index.htm]test page[/URL], Firefox displays the brown “Title goes here” <div> exactly the way I intended, which is above everything else. IE, places the <div> in the document flow as if the layer didn’t matter.

Here’s the CSS

[CODE]
#container{
height: 512px;
width: 75%;
margin-top: 30px;
margin: auto;
background: url(../images/diag.png);
}

#imagebox{
position:relative;
top: 0;
height: 512px;
width: 204px;
background: url(../images/shadow.png) no-repeat;
float: left;
padding-top: 16px;
padding-left: 16px;
padding-bottom:0;
padding-right:0;
z-index:1;
}

#leftimage{
background: url(../images/mountainroad.png) no-repeat;
position: relative;
height: 480px;
width: 172px;
margin: 0;
padding:0;
z-index:1;
}

#titlebox{
position: relative;
top: 30px;
width: 80%;
background: #666633;
margin: auto;
padding: 5px;
border: 1px solid;
z-index:2;
font-size :large;
text-decoration: none;
font-family:Georgia, “Times New Roman”, Times, serif;
}[/CODE]

Problems/questions:
1) In Firefox, why does the text in #titlebox not ignore the floated element beneath it and render to the left of the box like it’s supposed to?
2) IE, obviously, has interpreted my CSS differently than Firefox. Is this because there is a problem with IE, or does my code need work and Firefox is going easy on me?

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@ray326Apr 09.2005 — Have you tried validating your markup and styles?
×

Success!

Help @Walkeraj 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.9,
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,
)...