0

I am working on a sharepoint web application, and i have the following markup, which show a list of links:-

enter image description here

Now I am trying to add the following CSS rule:-

  1. to always show the first link which is located under "PMO Home" & "Back To Project" in bold.. this link in the above picture is named "testing123"

Now on some pages I have only one link "PMO Home" above the intended link, while on other pages i have 2 links as shown above.of course the intended link title differ (not always named testing123).. also as shown in the markup all the links have the following class in common "menu-item-text".. so can anyone adivce on this please?

Community
  • 1
  • 1
John John
  • 1
  • 72
  • 238
  • 501
  • 1
    If theres absolutelly no difference in classes, I suggest you select the element by its tree position. Like `.root li:nth-child(3) a.menu-item-text` – teefars Mar 24 '17 at 17:06
  • 1
    Can you amend the markup? – sheriffderek Mar 24 '17 at 18:25
  • 1
    What does the "PMO Home" & "Back To Project" links have that the one you want to target does not? ... it could be part of id, attribute, class on either the links or one of their parents – Asons Mar 24 '17 at 19:29
  • @teefars but as i mentioned the link i want to select might be listed second or third.. – John John Mar 25 '17 at 22:59
  • @LGSon nothing really differ but the order and the text.. as i said on some pages i have the "PMO Home" & "Back To Project" links then directly under them will be the link i want to select.. on other pages i will only have "PMO Home" , then the intended link, or i have "Back To Project" followed by the intended link.. so the link i want to select will either be under "PMO Home" & "Back To Project" OR under "PMO Home" only or under "Back To Project" only... of course the intended link might be followed by other links which i do not want to select.. – John John Mar 25 '17 at 23:03
  • @sheriffderek if you click on the screen shot i provide it will open infull screen – John John Mar 25 '17 at 23:23
  • 1
    Can you amend the markup? – sheriffderek Mar 26 '17 at 02:45
  • Based on your comment, you need follow the duplicate's link, where you will find several answers how to solve your issue – Asons Mar 26 '17 at 08:25
  • @sheriffderek no i do not have control over the markup .. as this is a sharepoint web page, where the markup will be generated for me but i can write custom css classes to modify the default markup .. – John John Mar 27 '17 at 01:16

0 Answers0