473,809 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

css alternate list background problem

not sure what i'm doing developing on xmas... but i guess we all have
our own demons! -lol-

i'm using the following css to style my horizontal menu...

/* STYLE HORIZONTAL MENU */

#hmenu ul
{
list-style: none;
padding: 0;
margin: 0;
}

#hmenu li
{
float: left;
margin: 0 0.15em;
padding: 0;
text-align: center
}

#hmenu li a
{
background: url(../images/hmenu.gif) #fff bottom left repeat-x;
height: 1.3em;
line-height: 1.3em;
float: left;
width: 7.5em;
display: block;
border: 0.1em solid #dcdce9;
color: #0d2474;
text-decoration: none;
text-align: center;
}

/* Commented backslash hack hides rule from IE5-Mac \*/
#hmenu li a
{
float: none
}
/* End IE5-Mac hack */

/* KEEP HMENU FROM WRAPPING */

#hmenu
{
width: 50em;
}

on the php side, i have a <ul> in a <div="hmenu"> .

everything works great except i want the ends of this list to have a
different background b/c they aren't links - they portray other
information (ie, contact phone number and current page name).

i've tried setting .blueback in my css document and putting
class="blueback " in the <a> and in the <li> with no luck.

i tried a.blueback and li.blueback.

no luck.

does anyone have any ideas? the css will reveal i'm using an image as
my main background and it continues to display no matter what i try.
tia...

....and merry christmas! :-)

Jul 21 '05 #1
11 6235
On 25 Dec 2004 19:42:11 -0800, skeeterbug <js******@san.r r.com> wrote:
not sure what i'm doing developing on xmas... but i guess we all have
our own demons! -lol-

i'm using the following css to style my horizontal menu...

Happy ho-ho to you. What I want for Xmas is a URL to an examplr of your
problem. That will really speed up the process.

Jingle jingle.
Jul 21 '05 #2
neal, the code isn't up b/c it has fallen and can't get up! ;-)

happy new year!!!

here is my html:

<div id="hmenu">
<ul>
<li><a class="white">< span><?php print $currentpage ?></span></a></li>
<li><a href="elistings .php">Email Listings</a></li>
<li><a href="listings. php">Online Listings</a></li>
<li><a href="mortgage. php">Mortgage Area</a></li>
<li><a href="drawing.p hp" class="red"><sp an>Enter To
Win!</span></a></li>
<li class="blueback "><a
class="white">< span>858-733-2886</span></a></li>
</ul>
</div>

here is my css:

li.blueback {background-color: #0d2474;

}

a.red span { color: #f00;
text-decoration: none;
}

a.white span { color: white;
text-decoration: none;

/* STYLE HORIZONTAL MENU */

#hmenu ul
{
list-style: none;
padding: 0;
margin: 0;
}

#hmenu li
{
float: left;
margin: 0 0.15em;
padding: 0;
text-align: center
}

#hmenu li a
{
background: url(../images/hmenu.gif) #fff bottom left repeat-x;
height: 1.3em;
line-height: 1.3em;
float: left;
width: 7.5em;
display: block;
border: 0.1em solid #dcdce9;
color: #0d2474;
text-decoration: none;
text-align: center;
}

Jul 21 '05 #3
On 25 Dec 2004 23:20:05 -0800, Skeets <sk*********@ya hoo.com> wrote:
neal, the code isn't up b/c it has fallen and can't get up! ;-)

happy new year!!!

here is my html:
Oh jeez, I'd be doing a disservice by wading through this. It simply won't
do.

Let me point out ways to improve, please.
<a class="white">< span><?php print $currentpage ?></span></a>
Why add a span? Why not style the a instead? The span unnecessarily
complicates your markup. And your CSS as a result. Please fix that up.

Geocities has free webspace. use that if you have access to nothing
better. Really, the ability to click and see is going to yield you more
responses than your current mess.
here is my css:

li.blueback {background-color: #0d2474;

}
If you define background-color, always also define color.

a.red span { color: #f00;
text-decoration: none;
}

a.white span { color: white;
text-decoration: none;


Close with }? Did you? That's why a URL is preferred...

And text-decoration: none? How do I know there's a link?

Please don't post more code. Get something online, post the URL. Please.

Jul 21 '05 #4
On Sun, 26 Dec 2004 02:50:46 -0500, Neal wrote:
..Get something online, post the URL. Please.


For more tips on preparing a test case..
<http://www.spartanicus .utvinternet.ie/help_us_help_yo u.htm>

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Jul 21 '05 #5
fair enough. i will set out to get it online tomorrow after i get some
sleep and get the links up to speed so that my site is consistently
brkern and not jsuper jacked up. i used span b/c i was having a
problem styling those <li>s. i agree it doesn't make much sense if i
can figure out the styling.

good point about the links. usability is on my list to improve.

i appreciate the interest in helping - thank you.

Neal wrote:
On 25 Dec 2004 23:20:05 -0800, Skeets <sk*********@ya hoo.com> wrote:
neal, the code isn't up b/c it has fallen and can't get up! ;-)

happy new year!!!

here is my html:
Oh jeez, I'd be doing a disservice by wading through this. It simply

won't do.

Let me point out ways to improve, please.
<a class="white">< span><?php print $currentpage ?></span></a>
Why add a span? Why not style the a instead? The span unnecessarily
complicates your markup. And your CSS as a result. Please fix that

up.
Geocities has free webspace. use that if you have access to nothing
better. Really, the ability to click and see is going to yield you more responses than your current mess.
here is my css:

li.blueback {background-color: #0d2474;

}


If you define background-color, always also define color.

a.red span { color: #f00;
text-decoration: none;
}

a.white span { color: white;
text-decoration: none;


Close with }? Did you? That's why a URL is preferred...

And text-decoration: none? How do I know there's a link?

Please don't post more code. Get something online, post the URL.

Please.

Jul 21 '05 #6
here's a link...

http://www.geocities.com/operationsengineer1/

i want the two side menu locations to have a solid dark blue background
and white text since they aren't going to links - they will display
information (current page and phone number).

i tried creating class

..blueback {background-color: blue;}

and call that class in <a class="blueback "> and <li class="blueback ">
for the appropriate list items. it didn't do what i hoped it would.

i think this may have something to do with the id i'm calling.

any help would be appreciated.

skeeterbug wrote:
not sure what i'm doing developing on xmas... but i guess we all have our own demons! -lol-

i'm using the following css to style my horizontal menu...

/* STYLE HORIZONTAL MENU */

#hmenu ul
{
list-style: none;
padding: 0;
margin: 0;
}

#hmenu li
{
float: left;
margin: 0 0.15em;
padding: 0;
text-align: center
}

#hmenu li a
{
background: url(../images/hmenu.gif) #fff bottom left repeat-x;
height: 1.3em;
line-height: 1.3em;
float: left;
width: 7.5em;
display: block;
border: 0.1em solid #dcdce9;
color: #0d2474;
text-decoration: none;
text-align: center;
}

/* Commented backslash hack hides rule from IE5-Mac \*/
#hmenu li a
{
float: none
}
/* End IE5-Mac hack */

/* KEEP HMENU FROM WRAPPING */

#hmenu
{
width: 50em;
}

on the php side, i have a <ul> in a <div="hmenu"> .

everything works great except i want the ends of this list to have a
different background b/c they aren't links - they portray other
information (ie, contact phone number and current page name).

i've tried setting .blueback in my css document and putting
class="blueback " in the <a> and in the <li> with no luck.

i tried a.blueback and li.blueback.

no luck.

does anyone have any ideas? the css will reveal i'm using an image as my main background and it continues to display no matter what i try.
tia...

...and merry christmas! :-)


Jul 21 '05 #7
skeeterbug wrote:
here's a link...

http://www.geocities.com/operationsengineer1/

Change
li a .blueback {background: blue bottom left repeat-x;}
to
#hmenu li.blueback, #hmenu a.blueback {color: white; background: blue
bottom left repeat-x;}
--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 21 '05 #8
Jim Moe wrote:
skeeterbug wrote:
here's a link...

http://www.geocities.com/operationsengineer1/

Change
li a .blueback {background: blue bottom left repeat-x;}
to
#hmenu li.blueback, #hmenu a.blueback {color: white; background: blue
bottom left repeat-x;}


Actually, this is all that is needed:
#hmenu a.blueback {...
or:
#hmenu ul li a.blueback {...
whereas this contributes nothing that I can see:
#hmenu li.blueback {...

Perhaps someone can explain the /reason/ as to why these don't work:
a.blueback {...
li a.blueback {...
ul li a.blueback {...

--
Gus
Jul 21 '05 #9
Gus Richter wrote:
skeeterbug wrote:
http://www.geocities.com/operationsengineer1/


Actually, this is all that is needed:
#hmenu a.blueback {...

Perhaps someone can explain the /reason/ as to why these don't work:
a.blueback {...
li a.blueback {...
ul li a.blueback {...


#hmenu has higher specificity than the more generic selectors, so the
existing rule

#hmenu li a {background: url(hmenu.gif) #fff bottom left repeat-x;...}

takes precedence. As an override, I would suggest
#hmenu li a.blueback {...}

and put it right after the first rule, mostly because it may make it
easier to read/follow, and subsequently easier to maintain.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2510
by: aznFETISH | last post by:
I have a list of links that I ue on my page, I alternate background colors for these links in a table, I usually do it using a DB but this list of link is manually added into the page so my question, is it possible to alternate the row colors automatic and have it created from a list of URL's?
1
4643
by: news | last post by:
Hi all, How do you implement alternate line colors in ms access datasheet view Regards Joe --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.512 / Virus Database: 309 - Release Date: 20/08/2003
4
2285
by: sconeek | last post by:
Hi all, I am generating a html based table with multiple rows of data coming in real time from a postgres DB. The underlying technology is java based however the front end is html. now i am unable to alternate the colour of every row so that the table is lot more readable. can anyone suggest a javascript or even a css script which will alternate the row colours irrespective of the number of rows.
1
4356
by: Eric Lindsay | last post by:
I am trying to understand the differences between and uses of persistent, default and alternate styles. I have read http://www.w3.org/TR/REC-html40/present/styles.html section 14.3.2 on specifying external style sheets in link using combinations of rel and using or not using the title attribute. I think I sort of understand rel="alternate stylesheet". It seems to be able to act something like the media="print" or media="handheld" or...
4
19562
by: Amy | last post by:
I need some help. I have this table with alternate row colors. Class gray and class white. I have javascript that do highlight when mouseover row ... and onclick to select row and highlight it with another color. Also created a class called "Selected". You can only select a row at a time. My problem is, if a row is preselected, when mouseover the selected row, the selected color is screwed. Until you click on the selected row once, the...
5
27607
by: Michael R | last post by:
Searching the net I've found a simple technique to add row numbers and alternate colors (for the even and the uneven row) to a continuous form. 1st step: Create a textbox, send it to background and select the first color. .ControlSouce =fRowNum(False) .Name = RowNum 2nd step: Add the following function to the form module: (for row numbers) Public Function fRowNum(Reset As Boolean) As Long Static I As Integer
3
2203
by: Charles Law | last post by:
Ok. I haven't been around for a while, so I hope someone will come to my rescue. I thought I had done this years ago, but I have scoured my code snippets and can't find it. I want my ListView control to have a different background colour on alternate rows. I'm using VS2005. Firstly, I'm surprised that I can't do it out of the box. But secondly, I can't find a really simple one-liner that let's me do it by overriding something.
18
4374
by: JohnDriver | last post by:
Hi, I am happy to say that with your help, I have been performing good in Ajax. Thanks for helping me to start with. I have a small problem now. I am pulling records from database and passing result of the query in a table. I would like some help with the code to colour the alternate rows please. function printQuery($param) { echo "<table width=100% valign=center>"; echo "<tr>"; foreach ($param as $key => $result)
2
6040
by: Wayne | last post by:
Has anyone found the "Alternate Background Color" property in Access 2007 forms to be buggy? As I scroll a continuous form that is using an alternate background color for every second record, the background colors get confused and go haywire. Nice feature if it worked propertly!
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10643
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10378
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10391
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10121
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.