How jQuery affects CSS structure

Just returning to the heavy js and CSS world after a couple of years working only in Flash and approaching speed in jQuery. I am developing CSS / DIV based layouts and will depend on jQuery and AJAX for interoperability.

Regarding CSS coding rules and structure, how can I create SS to make better use of jQuery?

What CSS concepts should I learn if I want my jQuery design work to match CSS?

Thx --steve ...

+4
source share
3 answers

Here are some jQuery performance rules that give some tips on how to set up identifiers and classes.

+6
source

You can take a look at jQuery UI CSS . This is a smart and jQuery-friendly way to style your user interface. Pretty neat stuff ...

+1
source

The basic rule is to use CSS wrt jQuery: use classes. and then use more classes. but make sure classes represent a "role" and not a "behavior"

for example: this is bad

<ul> <li class='red'><a href='http://microsoft.com/'>MS</a></li> <li><a href='http://google.com/'>goog</a></li> <li class='green-bg'><a href=http://ubuntu.com/'>Ubuntu</a></li> </ul> 

for example: this is good.

 <ul> <li class='bad-link'><a href='http://microsoft.com/'>MS</a></li> <li><a href='http://google.com/'>goog</a></li> <li class='current-link'><a href=http://ubuntu.com/'>Ubuntu</a></li> </ul> 

This subtle CSS convention allows you to do powerful things in the user interface with real ease.

Cheers, jrh.

+1
source

Source: https://habr.com/ru/post/1286065/


All Articles