Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Move this topic
Forum :
Getting Started
Using jQuery
Using jQuery Plugins
Using jQuery UI
Developing jQuery Core
Developing jQuery Plugins
Developing jQuery UI
QUnit and Testing
About the jQuery Forum
jQuery Conferences
jQuery Mobile
Developing jQuery Mobile
Sub forum :
Move this topic
Cancel
Getting Started
raj.js
selectors problem
in
Getting Started
•
10 years ago
both this structure comes in same page how to target this div
<div id="box_go">
in css
only difference is ul class....
i wanted to give two different border colors yellow and pink color this div <div id="box_go">
http://jsfiddle.net/LWutU/5/
zpass-current
<ul class="zpass-current zpass-homepage logo-med-whttxt clearfix">
<li>
<a href="">
<div class="entitlement">
<div id="box_go">
</div>
</div>
</a>
<li>
</ul>
zpass-header
<ul class="zpass-header zpass-homepage logo-med-whttxt clearfix">
<li>
<a href="">
<div class="entitlement">
<div id="box_go">
</div>
</div>
</a>
<li>
</ul>
1
Replies(7)
jakecigar
Re: selectors problem
10 years ago
An id has to be unique. You are lucky your page did not explode.
http://jsfiddle.net/jakecigar/LWutU/6/
Deals with non-unique ids. No guarantees it will work in all browsers!
$
(
'.zpass-current [id="box_go"]'
)
.
addClass
(
'yellow'
)
$
(
'.zpass-header [id="box_go"]'
)
.
addClass
(
'pink'
)
.
pink
{
border
:
1px
solid
pink
}
.
yellow
{
border
:
1px
solid
yellow
}
JΛ̊KE
Leave a comment on jakecigar's reply
raj.js
Re: selectors problem
10 years ago
@jakecigar: thanks for your reply
can you tell me with css only
i dont want to use jquery
Leave a comment on raj.js's reply
jakecigar
Re: selectors problem
10 years ago
Sometimes, a selector is just a selector
http://jsfiddle.net/jakecigar/LWutU/13/
JΛ̊KE
Leave a comment on jakecigar's reply
raj.js
Re: selectors problem
10 years ago
thanks for your reply
i wanted to use only css
Leave a comment on raj.js's reply
jakecigar
Re: selectors problem
10 years ago
That is CSS.
JΛ̊KE
Leave a comment on jakecigar's reply
raj.js
Re: selectors problem
10 years ago
thanks for your reply
can you tell me the name of this square bracket selector...
does it support all browsers
zpass-header
[
id
=
"box_go"
]
{
border
:
1px
solid
pink
}
Leave a comment on raj.js's reply
jakecigar
Re: selectors problem
10 years ago
Don’t forget the period!
.
zpass-header
[
id
=
"box_go"
]
{
border
:
1px
solid
pink
}
Most modern browsers support the square bracket notation ( called an attribute selector).
http://www.w3.org/TR/CSS2/selector.html#attribute-selectors
BUT, some may croak on re-using ids.
Why must the ID attribute be unique on each page? - HTML FAQ
Classes are for multiple elements. Ids are for unique elements.
JΛ̊KE
Leave a comment on jakecigar's reply
Change topic type
Topic Type :
Discussions
Questions
Ideas
Problems
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to raj.js's question
Top
Reply
{"z19494950":[14737000003632136,14737000003632149,14737000003632159,14737000003629671],"z2950240":[14737000003630242,14737000003630264,14737000003629525,14737000003629677]}
Statistics
7
Replies
1652
Views
1
Followers
Tags
No tags available for this topic.
Cancel
Actions
Permalink
Related Posts
Multiple selectors problem
[jQuery] Problem in selectors
[jQuery] [selectors] XML IE6 proble...
Problem with selectors
Problem with Simple Selectors