Solved

Last-child and Internet explorer

Posted on 2010-11-09
3
773 Views
Last Modified: 2012-05-10
Hi all,

I am using wordpress and on my menu I;m using last-child on my css.

I'm having issues with internet explorer. Is there anyway I can get last-child to work on internet explorer for my wordpress theme please?

Thanks

0
Comment
Question by:error77
3 Comments
 
LVL 6

Expert Comment

by:stilliard
ID: 34098406
Do you have jquery on your page? if so you could write a jquery fix for it to pick up the last child element for you.
like on here: http://stackoverflow.com/questions/1293369/using-last-child-in-css

last-child doesnt work in several browser versions unfortunatly, so either a javascript fix, or maybe find a way so instead you use first-child, e.g. if your using last child to cancel out a border to the right of each item in a list, maybe change the border to left and use first child to cancel it out.

0
 
LVL 2

Accepted Solution

by:
wasim117 earned 500 total points
ID: 34099670
You can try following code using jQuery last:selector.
<script>
  jQuery("ul.navigation li:last").addClass('last-item');
</script>

Open in new window

0
 

Author Closing Comment

by:error77
ID: 34100369
Thanks
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question