PDA

View Full Version : Conditional Statement in PHP



jp182
February 15th, 2007, 09:23 PM
Alright, it may look like i'm asking a question thats been answered before but I'm wondering about conditional statements in style sheets. For some reason this isn't working:


<style type="text/css">
body{
text-align:center;
background-image: url(images/tile.jpg);
background-repeat: repeat-y repeat-x;
}
A:link {text-decoration: underline;
color:black;
}
A:visited {text-decoration: underline;
color:black;
}
A:active {text-decoration: underline;
color:black;
}
A:hover {text-decoration: underline; color: red;}
#container {
width:950px;
margin:auto;
padding:0px;
text-align:left;
}
.floatright {
float: right;
margin: 5px 5px 5px 5px;
border: 1px solid #666;
}
.floatleft {
float: left;
margin: 10px 10px 10px 10px;
border: 1px solid #666;
}
.floatmiddle {
float: left;
margin: 5px 5px 5px 30px;
border: 1px solid #666;
}
.floatadvertise {
float: left;
margin: 5px 5px 5px 28px;

}
#left{
height:685px;
width:177px;
}
/* Looks like you have to specify the width of #menu
or IE5 Mac stretches it all the way across the div, and
Opera streches it half way. */
html>body #left {
/* ie5win fudge ends */
width:177px;
}
.leftmenu {
width:162px;
}
.leftmenu2{
width:162px;
height:644px;
}
#middle{
height:685px;
width:736px;
margin-left:5px;
width:711px;
}
/* Looks like you have to specify the width of #menu
or IE5 Mac stretches it all the way across the div, and
Opera streches it half way. */
html>body #middle { /* ie5win fudge ends */
width:730px;
}
.middlemenu {
width:722px;
}
.middlemenu2 {
width:728px;
height:650px;
}
a span {display: none;}
a {position: relative;}
a:hover {
background-color: #dbe4f2;
}
/* The above hover change defeats the
IE/Win display changing bug */
a:hover span {
display: block;
background: #999999;
border: 1px solid black;
position: absolute;
top: 448px;
left: -180px;
width:-160px;
padding:5px;
}
p.middlemenu2 a {z-index: 5;}
</style>
<style type="text/css">
<!--[if IE]>
a:hover span {
display: block;
background: #999999;
border: 1px solid black;
position: absolute;
top: -200px;
left: 500em;
width:160px;
padding:5px;
}
<![endif]-->
</style>

Here's the page:
http://www.thespeedlounge.com/info.php

I'm not sure what the conditional statement isn't working.

duncanhall
February 16th, 2007, 06:08 AM
Maybe I'm missing something here, but there isn't actually any PHP code in the sample you've posted above?

What is it you are trying to do, and what is it that is the problem?

dav666
February 16th, 2007, 08:35 AM
Hmmm as duncanhall has said above... There is no PHP in that script.

It's just plain CSS?

I have heard conditional statements won't work if you have installed a cracked version of Internet Explorer 7 to get around the Windows Genuine Advantage system (WGA).

So if you are using that, then this may be your answer. Other than that I have no clue. I've never needed to use any conditional statements before.

Sorry.

foodpk
February 16th, 2007, 01:25 PM
Those hacks, they're hurting my eyes, ow!

senocular
February 16th, 2007, 01:30 PM
Though the page is a PHP page, the issue relates to client-side HTML. Moving to Client-side forum :)

jp182
February 16th, 2007, 02:09 PM
thanks senocular. yes the page itself is a php page so i thought they may be the issue.

And no its not because of a hack version of IE, it's just not reading the conditions properly. Foodpack, leave my hacks alone :p If I could get these conditional statements to work, I'd just put all of them into an IE style sheet.

simplistik
February 17th, 2007, 12:46 PM
are you talkin about
<!--[if IE]>
a:hover span {
display: block;
background: #999999;
border: 1px solid black;
position: absolute;
top: -200px;
left: 500em;
width:160px;
padding:5px;
}
<![endif]-->

that conditional statement? you shouldn't need it at all