0

Is there a trick to get a parent of element? I have a html structure and i cannot edit this. I cannot use javascript. So, i just have css for solution. I was looking for some way, but i only found css4 and jquery solution. I need pure css trick or solution. Thank you.

(Javascript - html changes not allowed for me)

<h1> <a id="link1"> hello </a></h1>
<h1> <a id="link2"> hello </a></h1>
<h1> <a id="link3"> hello </a></h1>

I want the "#link1" parent. i tried using "h1:first-child" but elements order never is the same.

BoltClock
  • 630,065
  • 150
  • 1,295
  • 1,284
iLevi
  • 836
  • 4
  • 10
  • 25
  • I do not think. in which you mention accepts JS, Jquery, CSS4 solutions. This does not. – iLevi Jun 11 '13 at 22:19
  • It answers your question. If there was a trick using just CSS, it would be there. – dsgriffin Jun 11 '13 at 22:26
  • 1
    No there isn't. This is (still) impossible. Even under the proposed CSS 4 Selectors API, this won't be available. Reference: '[Fast vs Complete Selector Profiles](http://dev.w3.org/csswg/selectors4/#profiles).' – David says reinstate Monica Jun 11 '13 at 23:27

0 Answers0