>> SPEAKER 1: So it's definitely better design to put your CSS properties
inside of a style tag, inside of the head tag on the page, rather than use
style attributes throughout the rest of your source.
But suppose you want to use some of the same CSS
properties in multiple files.
>> Rather than copy and paste those properties into those disparate HTML
files, why not put them in one central .css file and then include that file
into multiple HTML pages, much like we put code in header files in order to
include it across multiple programs in C. Let's take a look.
>> Here in css-2.html.
I have a whole bunch of CSS properties that I'd like to factor out.
So let's go ahead and highlight those.
Cut them out.
And let's get rid of the style tags as well.
Let's now move to this other tab that I've already called css-2.css, and
paste in those CSS properties, saving the file.
>> Let's now go back to css-2.html and specify, still on the head, that we
want to link to the CSS file somehow.
Open bracket link href="css-2.css".
>> And then let's specify that the relationship of this link tag with the
document is to serve as a style sheet.
Link is what's known as an empty element so we can open and close the
tag in one single breath.
Let's now save the file, change it's permissions, and open it in a browser.
>> chmod a + r css-2.html.
Enter.
Now open up Chrome.
http://localhost/css-2.html.
>> I do see John Harvard's home page but not any of the
stylizations that I expected.
Now why might that be?
Well, let's go back to the terminal window and take a look with ls.
Let's go back here to gedit and in the terminal window type ls-l.
>> It seems to be that css-2.html is indeed readable by all, but notice I
made a mistake.
I did not similarly change the permissions on the .css file.
So right now, I, the file's owner, is the only one who can read or write it.
So let's fix that as well with chmod.
>> chmod a+r css-2.css.
>> Let's now go back to Chrome and reload.
And there is John Harvard's homepage.