Thursday, July 24, 2014

Day 16: CSS Selectors

Today I learned about CSS selectors.  

Update From Reviewing on 8/5/2013: Selectors are patterns that allow us to target html elements and apply CSS to them.   We have been creating css files and saving them as style.css.  We then insert this into the html file so that the file can apply the css to the html: <link rel="stylesheet" nref="css/style.css">.

The universal selector is a very powerful selector.  It selects every element on the page at once and applies the styles we set.  It takes precedence over all other selectors.  It goes like this:

* {
sample-property: sample-value;
}

If the universal selector is used, inheritance in CSS values will not work.  A descendant selector targets a descendant of another element. like so:

h1 span {
sample-property: sample-value;
}

id selectors have to be unique, while class selectors can be used on multiple elements.

Total Treehouse Points: 1,140
Treehouse Points by Subject Matter: HTML 663, CSS 447, and Miscellaneous
Treehouse Ranking (%): "You have more total points than 62% of all students."

Badge(s) Earned Today:
Selectors (CSS)

Courses Completed:
How to Make a Website
HTML 

Books Read or in Progress:
"Head First HTML and CSS," by E. Robson & E. Freeman (In progress, I've read the 37 pg. preface and the first 255 pgs. of actual content, which is the HTML section of the book)

Hours Spent Coding Today: 2
Total Hours Coding: 69

No comments:

Post a Comment