(3)選擇元素——(15)總結(Summary)

來源:互聯網
上載者:User

With the techniques that we have covered in this chapter, we should now be able to locate sets of elements on the page in a variety of ways. In particular, we learned how to style top-level and sub-level items in a nested list by using basic CSS selectors, apply different styles to different types of links by using attribute selectors, add rudimentary striping to a table by using either the custom jQuery selectors :oddand :evenor the advanced CSS selector :nth-child(), and highlight text within certain table cells by chainingjQuery methods.

擁有了本章我們講過的知識後,我們現在可以通過很多方法定位網頁上的一串元素。特別的,我們學會了使用基礎的css選取器在嵌套的結構中去定位頂部和子級的元素,學會了使用屬性選取器為不同類型的連結加上不同的樣式,使用定製選取器:odd和:even或者進階選取器:nth-child()給一個表加上交替的條紋,使用鏈狀jquery方法為特定的表格塊高亮文本。

So far, we have been using the $(document).ready()method to add a class to a matched set of elements. In the next chapter, we'll explore ways in which to add a class in response to a variety of user-initiated events.


相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.