HTML CS50
HTML CS50
Lecture2
● <1DOCTYPE html>
It means it’s a html 5 document written in the laser version of html.
● <html></html>
Beginning of the content of html website
● <head></head>
Information that is helpful for the web browser not stuff that is going to
be displayed in the main contents of the web page
----------------------------------------------------------------------------------------------------
HTML
● <a href=”link” >text</a> (links0.html)
“Href have the hyperlink that we want to link to when some one clicks
on the contents of inside the tag.”
“You can also use href tags to link contents on the same page”
ol li { colour: red; } -SPACE means that style all the descendants/list that
are contained within the ordered list .The only rule CSS following here is if
there is a list that is the descendant of or contained within ol than its going
to be red
The contents of ol are children and the content of the ul list are
grandchildren of the ol (child.html)
If you want to select only the immediate children but not the contents
of ul
ol > li { colour: red; }
> syntax for identifying directly descendants of ol
selector:pseudo-class {
property: value;
}
● Hover (hover.html)
<button>Clickme</button>
<style>
Button:hover { background-colour :orange; } </style>
CSS pseudo-elements
● : : before (before.html)
It means that I want to apply the styling before the contents of a
paricular code
<style>
a : : before {
content: “/21d2 click here:” ;
Font-weight: bold; } </style>
: : after does the same thing but after the contents of the code
● : : selection
When something is selected it behaves a certain way e.g change
colour