/    Sign up×
Community /Pin to ProfileBookmark

z-index not working for me…

I know something is wrong somewhere because this is actually working in ie but not firefox!!! My code validates but I can’t see my fancyl image that should sit under the text at the bottom of the page.

[COLOR=”Lime”]HERE IS MY CSS[/COLOR]

[QUOTE]

* {margin:0; padding:0; border:none;}

body {background-color:#94a8be;}

#container {width:960px;
background-color:#eee3c7;
margin-right:auto;
margin-left:auto;}

#header {background-image:url(‘images/header.jpg’);
height:171px;}

#menu {width:960px;
height:50px;}

#submenu {max-width:214px;
background-color:#012b5d;
position:absolute;
top:221px;
height:477px;}

#content {background-color:#eee3c7;
position:relative;
left:214px;
max-width:747px;
height:477px;}

p {margin-left:105px;
margin-right:105px;}

ul {list-style-position: inside}

li {padding-left:120px;}

img {display:block;}

.title {padding-top:60px;
padding-left:43px;}

.subtitle {margin: 15px 1px 5px 93px;}

.floatright {float:right;
position:relative;
bottom:30px;}

.fancyl {position:absolute;
right:40px;
bottom:10px;
z-index:-1;}

[/QUOTE]

[COLOR=”Lime”]
[COLOR=”Red”]HERE IS MY HTML [/COLOR] [/COLOR]

[QUOTE]

<!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” lang=”en” xml:lang= “en”>

<head><title>Legacy Preparatory Academy</title>

<link rel=”stylesheet” type=”text/css” href=”lpa.css” />
<script type=”text/javascript” language=”javascript” src=”loadimages.js”></script>

</head>

<body>

<div id=”container”>
<div id=”header”></div>

<div id=”menu”>

<!– Begin Navigation –>
<script type=”text/javascript” src=”menu/milonic_src.js”></script>
<noscript><a href=”http://www.milonic.com/”>JavaScript DHTML Menu Powered by Milonic</a></noscript>
<script type=”text/javascript” src=”menu/mmenudom.js”></script>
<script type=”text/javascript” src=”menu/menu_data.js”></script>

<!– End Navigation –>

</div>

<div id=”submenu”>
<img src=”images/smphilosophical.jpg” width=”214″ height=”219″ alt=”The Academy” />
</div>

<div id=”content”>
<img class=”title” src=”images/tphilosophical.gif” width=”328″ height=”29″ alt=”Philosophical Basics” />

<img class=”subtitle” src=”images/stmission.gif” width=”73″ height=”22″ alt=”Mission” />

<p>Legacy Preparatory Academy builds the foundation of knowledge and critical thinking skills necessary for children to become independent learners for life.<br /><br />
Our mission is to:</p>
<ul>
<li>Provide a classically-based curriculum that is thorough and challenging</li>
<li>Integrate fine arts to enhance learning</li>
<li>Teach the value of public virtue to promote respect</li>
<li>Engage parents as real partners to share in enriching student education</li>
<li>Honor each child as an individual and foster their innate curiosity and desire to learn</li></ul>

<img class=”fancyl” src=”images/fancyl.gif” width=”228″ height=”214″ alt=” ” />

</div>

</div>
</body>
</html>

[/QUOTE]

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelJan 22.2008 — I could be mistaken, but [I]negative[/I]-value z-indexes only work on IE. Try making the "-1" be "1" (or "+1") and raise everything else a number or two higher..
Copy linkTweet thisAlerts:
@CentauriJan 22.2008 — Why not use the image as a background to #content instead ?[CODE]#content {background-color:#eee3c7;
position:relative;
left:214px;
max-width:747px;
height:477px;
background-image: url(images/fancyl.gif);
background-repeat: no-repeat;
background-position: right bottom;
}[/CODE]
Copy linkTweet thisAlerts:
@motherandmoreauthorJan 22.2008 — w3 schools has z-index listed for ie, ff, and n. I've tried playing with the z-index numbers and have been able to make it show up but not below the text.

Any other ideas anyone, please?
Copy linkTweet thisAlerts:
@motherandmoreauthorJan 22.2008 — I think I've found it...looks like it needs to follow position-relative and I wanted it under position-absolute
Copy linkTweet thisAlerts:
@motherandmoreauthorJan 22.2008 — nope, that's not it...still need help please
Copy linkTweet thisAlerts:
@WebJoelJan 23.2008 — I got rid of the z-index thing (you don't need it, this mage is not expected to 'move'), changed some stuff, etc. Just small tweakages mostly, all in your "<STYLE></STYLE>".

This looks okay now, validates and looks the same now for IE and Fx.<!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" lang="en" xml:lang= "en">

<head>

<title>Legacy Preparatory Academy</title>

<link rel="stylesheet" type="text/css" href="lpa.css" />

<script type="text/javascript" language="javascript" src="loadimages.js"></script>

<style type="text/css">

* {margin:0; padding:0; border:none;}

body {background-color:#94a8be;}

#container {width:960px;

position:relative; overflow:hidden;

background-color:#eee3c7;

margin:0 auto;

}

#header {background-image:url('images/header.jpg');

position:relative; width:auto; border-bottom:3px double silver; height:171px;

padding:10px 20px;}

#menu {/*width:960px;*/ width:210px; border:1px solid green; height:auto; /*height:50px;*/}

#submenu {max-width:214px;

position:absolute; left:0;

background-color:#012b5d;

height:477px;}

#content {background-color:#eee3c7;

margin-left:220px; width:auto; border:2px solid purple

position:relative;

max-width:747px;

padding:0 10px 10px 0;

height:auto;/*477px;*/}

p {margin-left:105px;

margin-right:105px;}

ul {list-style-position: inside}

li {padding-left:/*1*/20px;}

img {display:block;}

.title {padding-top:60px;

padding-left:43px;}

.subtitle {margin: 15px 1px 5px 93px;}

.floatright {float:right;

position:relative;

bottom:30px;}

.fancyl {position:relative; /*absolute;*/

float:right; border:1px solid black;

}

</style>

</head>


<body>

<div id="container">

<div id="header"><h1>This is the header</h1></div>


<div id="menu">

<!-- Begin Navigation -->

<script type="text/javascript" src="menu/milonic_src.js"></script>

<noscript><a href="http://www.milonic.com/">JavaScript DHTML Menu Powered by Milonic</a></noscript>

<script type="text/javascript" src="menu/mmenudom.js"></script>

<script type="text/javascript" src="menu/menu_data.js"></script>

<!-- End Navigation -->

</div>

<div id="submenu">

<img src="images/smphilosophical.jpg" width="214" height="219" alt="The Academy" />

</div>

<div id="content">

<img class="title" src="images/tphilosophical.gif" width="328" height="29" alt="Philosophical Basics" />

<img class="subtitle" src="images/stmission.gif" width="73" height="22" alt="Mission" />

<p>Legacy Preparatory Academy builds the foundation of knowledge and critical thinking skills necessary for children to become independent learners for life.</p>

<h2 title="Our mission is to:" style="margin:30px 0 30px 75px;">Our mission is to:</h2>

<img alt="this is an image" class="fancyl" src="images/fancyl.gif" width="228" height="214" />

<ul>

<li>Provide a classically-based curriculum that is thorough and challenging</li>

<li>Integrate fine arts to enhance learning</li>

<li>Teach the value of public virtue to promote respect</li>

<li>Engage parents as real partners to share in enriching student education</li>

<li>Honor each child as an individual and foster their innate curiosity and desire to learn</li></ul>

</div>

</div>

</body>

</html>[/QUOTE]
×

Success!

Help @motherandmore 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...