J
Jeff
Hey
Here is my html/css code. I got 2 problems with it:
A) The <ul> doesn't align It doesn't align to the left, it's placed I guess
it's about 20 - 60 pixels to the right for the left margin. But I want this
<ul> block to align with the left margin - > i don't want this open space
between the left margin and the <ul>
B) The code in menu css is taken from an example on the internet... In the
example it uses these 2 css blocks to change the setting of the link the
mouse is hovering over:
#navigation a:hover
#navigation a:hover
But instead of a hovering effect I want to convert this css block to be show
the current selected item in the ul block. I mean if u could show me how to
embedd this css block in the html code, then I can do the rest... The actual
page will be genereated using php, so in php I use a if-test... if selected
then do this, if not selected to that....
I tryed using this html/css (the css blocks here are just the same css
blocks as mentioned above, but they have been renamed)... what I've done in
this code below isn't working, this item in the list isn't shown with a
different color than the other items...
<li><a class="selL" href="#"><span class="selR">TEST 1</span></a></li>
#selL
{
color: #fff;
background: #781351 url(../left-tab-hover.gif) left top no-repeat;
padding-left: 10px
}
/*#navigation a:hover span*/
#selR
{
background:url(../right-tab-hover.gif) right top no-repeat;
padding-right: 10px
}
Please if u see what I'm doing wrong, then please tell me what I should do
to solve this 2 problems..
*****************************************************************
Here is my files, index.php, menu.css and general.css
<!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>TEST</title>
<link href='css/general.css' rel='stylesheet' type='text/css' />
<link href='css/menu.css' rel='stylesheet' type='text/css' />
</head>
<body>
<table width="100%" border="0">
<tr >
<td align="left" bgcolor="#00FFFF">
<ul id="navigation">
<li><a href="#"><span>TEST 1</span></a></li>
<li><a href="#"><span>TEST 2</span></a></li>
<li><a href="#"><span>TEST 3</span></a></li>
<li><a href="#"><span>TEST 4</span></a></li>
<li><a href="#"><span>TEST 5</span></a></li>
<li><a href="#"><span>TEST 6</span></a></li>
<li><a href="#"><span>TEST 7</span></a></li>
<li><a href="#"><span>TEST 8</span></a></li>
</ul>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0">
<tr>
<td width="200"> </td>
<td> </td>
<td width="200"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</body>
</html>
*********************************************************
menu.css:
#navigation a
{
color: #000;
/*background: #ffa20c url(left-tab.gif) left top no-repeat;*/
background: #eeeecc url(../left-tab.gif) left top no-repeat;
text-decoration: none;
padding-left: 10px
}
#navigation a span
{
background: url(../right-tab.gif) right top no-repeat;
padding-right: 10px
}
#navigation a, #navigation a span
{
display: block;
float: left
}
/* Hide from IE5-Mac \*/
#navigation a, #navigation a span
{
float: none
}
/* End hide */
#navigation a:hover
{
color: #fff;
background: #781351 url(../left-tab-hover.gif) left top no-repeat;
padding-left: 10px
}
#navigation a:hover span
{
background:url(../right-tab-hover.gif) right top no-repeat;
padding-right: 10px
}
#navigation ul
{
list-style: none;
padding: 0;
margin: 0;
}
#navigation li
{
float: left;
margin: 0;
} /* CSS Document */
*******************************************************
general.css:
body {
background-color:#FFFFFF;
}
a:link {
text-decoration:none;
}
Here is my html/css code. I got 2 problems with it:
A) The <ul> doesn't align It doesn't align to the left, it's placed I guess
it's about 20 - 60 pixels to the right for the left margin. But I want this
<ul> block to align with the left margin - > i don't want this open space
between the left margin and the <ul>
B) The code in menu css is taken from an example on the internet... In the
example it uses these 2 css blocks to change the setting of the link the
mouse is hovering over:
#navigation a:hover
#navigation a:hover
But instead of a hovering effect I want to convert this css block to be show
the current selected item in the ul block. I mean if u could show me how to
embedd this css block in the html code, then I can do the rest... The actual
page will be genereated using php, so in php I use a if-test... if selected
then do this, if not selected to that....
I tryed using this html/css (the css blocks here are just the same css
blocks as mentioned above, but they have been renamed)... what I've done in
this code below isn't working, this item in the list isn't shown with a
different color than the other items...
<li><a class="selL" href="#"><span class="selR">TEST 1</span></a></li>
#selL
{
color: #fff;
background: #781351 url(../left-tab-hover.gif) left top no-repeat;
padding-left: 10px
}
/*#navigation a:hover span*/
#selR
{
background:url(../right-tab-hover.gif) right top no-repeat;
padding-right: 10px
}
Please if u see what I'm doing wrong, then please tell me what I should do
to solve this 2 problems..
*****************************************************************
Here is my files, index.php, menu.css and general.css
<!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>TEST</title>
<link href='css/general.css' rel='stylesheet' type='text/css' />
<link href='css/menu.css' rel='stylesheet' type='text/css' />
</head>
<body>
<table width="100%" border="0">
<tr >
<td align="left" bgcolor="#00FFFF">
<ul id="navigation">
<li><a href="#"><span>TEST 1</span></a></li>
<li><a href="#"><span>TEST 2</span></a></li>
<li><a href="#"><span>TEST 3</span></a></li>
<li><a href="#"><span>TEST 4</span></a></li>
<li><a href="#"><span>TEST 5</span></a></li>
<li><a href="#"><span>TEST 6</span></a></li>
<li><a href="#"><span>TEST 7</span></a></li>
<li><a href="#"><span>TEST 8</span></a></li>
</ul>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0">
<tr>
<td width="200"> </td>
<td> </td>
<td width="200"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</body>
</html>
*********************************************************
menu.css:
#navigation a
{
color: #000;
/*background: #ffa20c url(left-tab.gif) left top no-repeat;*/
background: #eeeecc url(../left-tab.gif) left top no-repeat;
text-decoration: none;
padding-left: 10px
}
#navigation a span
{
background: url(../right-tab.gif) right top no-repeat;
padding-right: 10px
}
#navigation a, #navigation a span
{
display: block;
float: left
}
/* Hide from IE5-Mac \*/
#navigation a, #navigation a span
{
float: none
}
/* End hide */
#navigation a:hover
{
color: #fff;
background: #781351 url(../left-tab-hover.gif) left top no-repeat;
padding-left: 10px
}
#navigation a:hover span
{
background:url(../right-tab-hover.gif) right top no-repeat;
padding-right: 10px
}
#navigation ul
{
list-style: none;
padding: 0;
margin: 0;
}
#navigation li
{
float: left;
margin: 0;
} /* CSS Document */
*******************************************************
general.css:
body {
background-color:#FFFFFF;
}
a:link {
text-decoration:none;
}