Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert this jquery code to css?

Tags:

jquery

css

I try to change float attribute of menu item by css. I want when body tag has rtl class , float of menu items set with right I wrote this jquery for do this but must done this change before load page .At the result I want do this work with css .

if ($('body').hasClass("rtl")) { $('#cssmenu > ul > li').attr('float','right');}

Now How to convert this jquery code to css?

like image 310
hmahdavi Avatar asked Mar 07 '26 21:03

hmahdavi


1 Answers

You can use

body.rtl #cssmenu > ul > li {
    float: right;
}

The JS code in question has many errors. Here's one if still interested to use JS.

$('body.rtl #cssmenu > ul > li').css('float', 'right');
like image 72
Tushar Avatar answered Mar 10 '26 09:03

Tushar