Tuesday, December 8, 2015

CSS Selectors: Classes and IDs

CSS Selectors: Classes and IDs


Now that we have the basics, let’s talk more about selectors. Here is the syntax we showed you earlier. CSS is made up of a selector, and property value pairs. CSS has different types of selectors. Let’s open our text editor, and browser, and look at type selectors first. Type selectors refer to HTML elements within the page. Here is the HTML generating the page, you can see the H1 and H2 headers, paragraphs, and a list. Now let’s look at the CSS. If we want to turn the first H1 tag blue we change the color to blue and refresh the page. So, type selectors select all the elements of a certain type of HTML tag, like divs, spans, headings, paragraphs. Any visible HTML element. CSS Selectors: Classes and IDs.

 

No comments:

Post a Comment