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

Home Posts Topics Members FAQ

Applying background color to ordered list numbers, NOT content

HaLo2FrEeEk
404 Contributor
I need to know how / if it's possible to apply a background color to a ordered list item's numbers, and not the content itself. I've tried:

Expand|Select|Wrap|Line Numbers
  1. ol {
  2.    background-color: #FFFF00;
  3.    }
But that does the opposite, applies the background color to the list's contents, but not the numbers. I'm making a syntax highlighting script that shows line numbers and I need to be able to clearly separate the line numbers from the code.

Can someone help me achieve this please?
Jun 8 '10 #1
1 3834
HaLo2FrEeEk
404 Contributor
That's much more elegant than my solution, but it doesn't work in IE7. My logs show I'm still getting a decent number of visits from IE7 users. Here's the page with my solution:

http://infectionist.com/extras/cshar...blf_struct.php

It even works on my Android phone.
Jun 9 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
11776
by: Ken Innes | last post by:
Apparently, surrounding an ordered list by a font command is illegal. So how do I specify the font style and size for the list elements? Putting font tags on each list item works, except that the list numbers don't display in that font. Invalid, but it works on all (most?) browsers: <font face="Arial" size=2> <ol> <li>List Item A<br>
6
35594
by: Stephen Miller | last post by:
Hi, How can I configure an ordered list so that the bullet is placed on the right hand side of the list item. ie: list item 1 * list item 2 * list item 3 * Thanks,
33
3921
by: Jim Cobban | last post by:
I cannot get Netscape 4.79 to properly display the ordered list in the following fragment. <P>Get a specific portion of the date. Depending upon the value of index: <ol start=0> <li>complete value, usually as a <code>String</code>, or if an integral value as an <code>Integer</code>. <li>year as an <code>Integer</code> <li>month number as an <code>Integer</code>
2
1847
by: Bosconian | last post by:
I have two multiple select inputs. Initially the first contains a bunch of items and the second is empty. Using a common method, I move items back and forth by double clicking on them. This portion works perfectly, but I would also like to change the background color of the select element with the current focus. I have defined the following classes: ..selected {
13
15969
by: deko | last post by:
http://www.liarsscourge.com/ewpi.html The list numbers should be formatted as <h3>, but other text within the <li> should be normal text. <ol> <li> <h3 id="d2">Download latest WordPress code</h3> </li>
20
2933
by: shapper | last post by:
Hello, I have the following: <ol id ="ol"> <li id="li1">item1</li> <li id="li2">item2</li> <ol> Is it possible to display the List Items on the horizontal, i.e., side
0
1813
by: zimmerman222 | last post by:
I'm developing a page in order to present map with a legend. The temporary URL is http://www24.brinkster.com/plaidthermos/legend.html I would like to have the legend's <li> numbers have the same background circle as the items it refers to on the map. I have managed to get a background image for each li, but it can't seem to display the image as a background beyond the left margin of the actual list item, the space occupied by the actual...
0
1922
by: Yoav Rubin | last post by:
Hi All, I am using an ordered list in which each item is a div that its size is two times as much as the size of the numbers of the ordered list. As it is now, the numbers are aligned to the bottom of the list items, and I'd like to align the numbers to be in the middle of the list items. Does anyone has any idea how to do it? thanks Yoav
0
1796
by: =?Utf-8?B?U2V0aA==?= | last post by:
I have a simple test application with a list view using custom draw to change the text background color. The list view uses a background image which I set using LVBKIMAGE img = {LVBKIF_SOURCE_URL, NULL, "file://C:\\source\\mcp\\ebs.jpg"}; ListView_SetBkImage(hList, &img); I have a linker pragma comment that I use to engage comctl32.dll version 6 to get the XP visual styles:
16
3675
by: some old html fumbler | last post by:
I want to use CSS to get an ordered list to start with something other than a 1 or equivalent. I have a list of things that happen during the course of a year. Too long a list is not helpful, so I only show maybe 3 months of items at a time. The items have to be ordered according to the year, IOW I can't list something in April as being #1. In HTML after the first couple of months I just use this sort of code: <ol start="14"...
0
9721
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
9600
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
10376
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...
0
9198
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
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
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.