Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
CSS first-parent selector?
Old 08-16-2010, 11:27 AM CSS first-parent selector?
Extreme Talker

Posts: 246
Trades: 0
From what I've read there is no first-parent selector, but is there a way to mimic this functionality? (Please do not suggest JQuery, I already know I can do this with JQuery). I need a purely CSS way of doing this.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
stbuchok is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-16-2010, 02:41 PM Re: CSS first-parent selector?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
CSS has no scripting capabilities. if the property does not exist in the specification you can't refer to it.

However, why do you need jquery?

"element.parent" or "this.parent" will suffice.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-16-2010, 03:19 PM Re: CSS first-parent selector?
Extreme Talker

Posts: 246
Trades: 0
I never said I wanted to use JQuery I said don't suggest it (really this would include javascript as well). I wanted a purely CSS way of grabbing the parent element for use in a CSS selector, which is why I said "purely CSS".

After much research I have come to the conclusion that this is not possible and will have to do what I need in a different way.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
stbuchok is offline
Reply With Quote
View Public Profile
 
Old 09-02-2010, 11:59 AM Re: CSS first-parent selector?
Average Talker

Posts: 19
Name: Colton
Location: NC, USA
Trades: 0
There is no ":first-parent" selector, but there is a ":first-child" selector. For instance:
Code:
div:first-child {
   /* Your CSS styles */
}
Colton is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS first-parent selector?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.14699 seconds with 12 queries