|
Posted by acord on March 10, 2006, 9:13 am
Please log in for more thread options
Hi,
I want to change the background color of a ul/li row, but the following
code is not working as I expected. It works in <table><tr>...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<style type="text/css">
#css_table {font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:11px; color:003366;}
#css_table ul {
padding: 0;
margin: 0;
list-style: none;
line-height:24px;
clear:both;
}
#css_table ul li {
padding:2px 8px 2px 8px;
width:auto;
border:1px solid #333333;
float:left;
}
</style>
<body>
<div id="css_table">
<ul onMouseOver="this.bgColor = '#C0C0C0'" onMouseOut ="this.bgColor =
'#FFFFFF'" bgcolor="#FFFFFF">
<li style="width:400px;">Jim</li>
<li>The</li>
<li>Fun</li>
<li>Begins</li>
<li><!-- Put Icon --> Here</li>
</ul>
<ul onMouseOver="this.bgColor = '#C0C0C0'" onMouseOut ="this.bgColor =
'#FFFFFF'" bgcolor="#FFFFFF">
<li style="width:400px;">Jim</li>
<li>The</li>
<li>Fun</li>
<li>Begins</li>
<li>Here</li>
</ul>
<ul onMouseOver="this.bgColor = '#C0C0C0'" onMouseOut ="this.bgColor =
'#FFFFFF'" bgcolor="#FFFFFF">
<li style="width:400px;">Jim</li>
<li>The</li>
<li>Fun</li>
<li>Begins</li>
<li>Here</li>
</ul>
</div>
</body>
</html>
|
|
Posted by Ian Rastall on March 10, 2006, 9:28 am
Please log in for more thread options
wrote:
>the following
>code is not working as I expected
>
></head>
><style type="text/css">
Hi acord. The <style> section belongs in the <head> section. Right now
you have it in the <body> section.
Ian
--
http://sundry.ws/
|
|
Posted by Ian Rastall on March 10, 2006, 9:59 am
Please log in for more thread options
wrote:
>The <style> section belongs in the <head> section. Right now
>you have it in the <body> section.
Or, rather, it's inbetween the <body> and <head> sections, which is a
no-man's land. Nothing should be inbetween those two sections.
HTH HAND,
Ian
--
http://sundry.ws/
|
|
Posted by acord on March 10, 2006, 6:35 pm
Please log in for more thread options
Ian Rastall wrote:
> wrote:
>
>
>>The <style> section belongs in the <head> section. Right now
>>you have it in the <body> section.
>
>
> Or, rather, it's inbetween the <body> and <head> sections, which is a
> no-man's land. Nothing should be inbetween those two sections.
>
> HTH HAND,
>
> Ian
does it work at your end? it doesn't make may differnet here.
Thanks
A
|
|
Posted by Ian Rastall on March 10, 2006, 6:45 pm
Please log in for more thread options
wrote:
>does it work at your end? it doesn't make may differnet here.
I apologize, I didn't check your code. Just trust me that the first
thing you have to do is put the <style> section in your <head>
section, though where is unimportant, as long as it's nested inside
<head>. After that, then work on the actual CSS.
Not to talk down to you, but to put it in basic terms, there is one
<html> section, with only two sections allowable inside it: <head> and
<body>. Everything goes inside one of those two. Nothing else is
allowed.
Ian
--
http://sundry.ws/
|
| Similar Threads | Posted | | DIV and BGCOLOR | September 22, 2008, 7:35 pm |
| BGCOLOR only in Opera, not other browsers (valid page) | May 4, 2008, 1:38 am |
| How can I change the value in a css class? | October 18, 2005, 9:04 am |
| change CSS definition by javascrip | May 13, 2005, 2:07 pm |
| Formmail form "From:" how to change | June 21, 2005, 5:45 pm |
| Website needs refresh to change | May 15, 2007, 10:06 am |
| Change password Databse | March 23, 2008, 4:48 am |
| change link colors in p class | September 30, 2004, 6:18 pm |
| Table cells change size | March 1, 2005, 9:02 pm |
| Can the color of list markers change? | April 5, 2005, 4:40 pm |
|