- add it to the page from (Insert Ribbon tab > Web Part) Media and Content category
- open the Web Part Properties (e.g. from Webpart tab in the Ribbon when Web Part is selected)
- an Edit Snippet link appears in the right bottom corner of the Web Part, click it
You can use Content Editor Web Part to add custom HTML and CSS to the page, or add content straight to the HTML source of a Foundation site, and use the script in the Script Editor Web Part to control the behavior of these - or any other elements on the page, including other Web Parts.