473,471 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

colon in css definition name


hi everybody,

Need help! Is there a way to escape the : character in a css definition
name?

#checkUsername:Messages {
padding: 10px 10px 10px 10px;
background-color:#FFFFCC;
color: #f00;
font-size: 12px;
border : 1 solid F00;
}

I encounter this ID naming convention with : char in JavaServerFaces
elements. THe elements are tightly coupled with the IDs and this is how
it is rendered to HTML.

Thanks,
Eson.

Jun 14 '06 #1
4 3500
et******@gmail.com wrote:
Need help! Is there a way to escape the : character in a css definition
name?


Second bullet point: http://www.w3.org/TR/CSS2/syndata.html#q4

Jun 14 '06 #2
David Dorward <do*****@gmail.com> scripsit:
et******@gmail.com wrote:
Need help! Is there a way to escape the : character in a css
definition name?


Second bullet point: http://www.w3.org/TR/CSS2/syndata.html#q4


Now that you taught the OP to fish, I could give a fish, mainly to help to
check that the (somewhat complex) text was understood correctly: there are
several ways to escape characters in CSS, but in cases like this, it
suffices to prefix the colon by the backslash (reverse solidus) character,
using \: instead of plain :.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 14 '06 #3
sgollery
2 New Member
Jukka and David,

Sadly but not unexpectedly, the backslash escape works in Firefox but not in IE. For example:

<!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" lang="en" xml:lang="en">
<head>
<style type="text/css">
#first\:second {
color:red;
}
</style>
</head>
<body>
<label id="first:second">This should be red</label>
</body>
</html>


prints in red in Firefox but not IE.

Are there any other ways to go that would work in more browsers?

Thanks,

Steve Gollery
Jul 12 '06 #4
sgollery
2 New Member
Answering my own question: use the hex:
#first\003Asecond

This works in both browsers
Jul 12 '06 #5

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

Similar topics

0
by: Cindy Mueller | last post by:
--F0.5BD08B6_ABBB95C Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html> <body> <div align=3D"center"> <center> <table border=3D"0" cellspacing=3D"1" width=3D"100%">...
0
by: Maurice Mclain | last post by:
--7FC.__338__A.F0643A1 Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html> <body> <div align=3D"center"> <center> <table border=3D"0" cellspacing=3D"1"...
1
by: Jadow | last post by:
Hi I have an application that needs to handle non-xml characters in the tag names such as a colon. I have not found how to escape this. I do not want to reject the document but rather...
6
by: yvinogradov | last post by:
I have a qustion about the attached piece of code. It compiles on gcc version 3.4.1 (Cygwin special). The line in question has a single colon instead of double. With double colon everything works...
1
by: jw56578 | last post by:
I've seen some system sp's that have a semi colon and number after the the name such as create procedure sp_procedure_params_rowset;2 what does this do?
2
by: Andreas | last post by:
Hi. Im writing a set of smaller editors for custom xml based file types. I want each of these files to be associated with the appropriate editor. However I find short extensions to be a little hard...
161
by: Dan Lenski | last post by:
Hi all, I'm a recent, belated convert from Perl. I work in a physics lab and have been using Python to automate a lot of measurement equipment lately. It works fabulously for this purpose. ...
2
by: Clint Stowers | last post by:
I have a query with a field name of "Street", however, I would like it to read "CAT:STREET". This query is exported to a csv file that requires the format of the later. Currently the csv file...
4
BeemerBiker
by: BeemerBiker | last post by:
I can create an access database with a colon in the field name, but I cant access it. I tried escaping the colon with single, double quotes and the backslash but didnt find a combo that worked. ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
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.