最近在看HeadFirstHTML与CSS,虽然是小白书,但是我对于前端并没有系统的学习过,都是用到了再看,所以掌握的不是很好。
因此想补充自己前端的知识。
关于这本书的学习笔记我只写这一篇(接下来继续看HTML5及JS的相关知识)
代码素材地址:https://github.com/youaresherlock/headfirstHtmlAndCSS
HTML5 DOM 为 和 元素提供了方法、属性和事件。
这些方法、属性和事件允许您使用 JavaScript 来操作 和 元素。
我们下面通过在网页中加入视频:
blog.html
Starbuzz Coffee - Blog
BEVERAGES
House Blend, $1.49
Mocha Cafe Latte, $2.35
Cappuccino, $1.89
Chai Tea, $1.85
ELIXIRS
We proudly serve elixirs brewed by our friends
at the Head First Lounge.
Green Tea Cooler, $2.99
Raspberry Ice Concentration, $2.99
Blueberry Bliss Elixir, $2.99
Cranberry Antioxidant Blast, $2.99
Chai Chiller, $2.99
Black Brain Brew, $2.99
Starbuzz launches... Tweet Sip
5/3/2012
As promised, today I'm proud to announce that Starbuzz
Coffee is launching the Tweet Sip cup, a special Starbuzz
Coffee cup that tweets each time you take a sip! Check
out my video of our new invention.
Sorry, your browser doesn't support the video element
Starbuzz meets social media
3/12/2012
Here at Starbuzz we're embracing the social media craze.
In fact, we're going further than any of our competitors and
we're very close to announcing a revolutionary new product that
links your coffee drinking directly to your social
network. Forget "checking in"; we're going way beyond that, and
with this new product every sip of smooth, aromatic, hot Starbuzz
blend is going to to be shared with your social network.
Sound like science fiction? It's not; I'm already
testing our final prototype social network cup as I write this,
which links you, the drinker, right to your favorite social
networks. We've made a huge investment to make this happen
and we've created a reusable coffee cup complete with RFID,
NFC, Bluetooth, and Wifi (not to mention a few more things the tech
folks know about, because hey, I'm just the coffee guy).
So, keep your eyes out for this amazing new cup. And I'll
be releasing a video teaser soon to tell you all about this
new invention, straight from Starbuzz Coffee.
Starbuzz uses computer science
3/10/2012
Have you ever noticed how efficient a Starbuzz Coffee
house is? The lines alway move fast, and despite the
astronomical number of different drinks any customer can
order, we have your drink up, hot (or cold if that's the
way you want it) and ready in seconds. How do we do it?
To pull this off, we take advantage of the latest and
greatest in computer science. In fact, we train
our staff to be one big distributed computer. The cashiers
create the orders for the distributed computer, complete
with your name and the drinks special instructions. Then
our specialized drink makers grab the next cup
and go about working on your order until it's finished.
With this design, we are able to horizontally scale our operation
any time we want. All we need to do is add more cashiers
and drink makers (not to mention a fair amount of support
staff you never see) as the customer flow grows.
Most unique patron of the month
2/18/2012
Our most unique patron of the month award goes to a
customer in Poulsbo, Washington, whose daily morning order
is a "six-splenda, no-foam, 130-degree non-fat-soy latte,
with the splenda stirred in before the milk is added." Do we
have unique customers or what?
ORDER ONLINE
with the
BEAN MACHINE
FAST
FRESH
TO YOUR DOOR
Why wait? You can order all our fine coffees right from the Internet with our new,
automated Bean Machine. How does it work? Just click on the Bean Machine link,
enter your order, and behind the scenes, your coffee is roasted, ground
(if you want), packaged, and shipped to your door.
© 2012, Starbuzz Coffee
All trademarks and registered trademarks appearing on
this site are the property of their respective owners.
starbuzz.css
body {
background-color: #b5a789;
font-family: Georgia, "Times New Roman", Times, serif;
font-size: small;
margin: 0px;
}
/*
height messes up the headers in the blog in the articles
it's only appropriate for the top header.
add a class (new with blog)
Affects the 3 #header rules for the main header below
In HTML: add class="top" to main header in index.html and blog.html
*/
header.top {
background-color: #675c47;
margin: 10px 10px 0px 10px;
height: 108px;
}
header.top img#headerSlogan {
float: right;
}
div#tableContainer {
display: table;
border-spacing: 10px;
}
div#tableRow {
display: table-row;
}
section#drinks {
display: table-cell;
background-color: #efe5d0;
width: 20%;
padding: 15px;
vertical-align: top;
}
/* added section#blog for blog
通过使用两个id选择器(用逗号分离), 可以对这两个元素使用相同的规则
虽然("main" 和 "blog" )在不同的页面上,也可以这样选择,
因为这两个页面都链接到相同的CSS文件*/
section#main, section#blog {
display:table-cell;
background: #efe5d0 url(images/background.gif) top left;
font-size: 105%;
padding: 15px;
vertical-align: top;
}
aside {
display: table-cell;
background: #efe5d0 url(images/background.gif) bottom right;
font-size: 105%;
padding: 15px;
vertical-align: top;
}
footer {
background-color: #675c47;
color: #efe5d0;
text-align: center;
padding: 15px;
margin: 0px 10px 10px 10px;
font-size: 90%;
}
h1 {
font-size: 120%;
color: #954b4b;
}
h2 { font-size: 110%; }
.slogan { color: #954b4b; }
.beanheading {
text-align: center;
line-height: 1.8em;
}
a:link {
color: #b76666;
text-decoration: none;
border-bottom: thin dotted #b76666;
}
a:visited {
color: #675c47;
text-decoration: none;
border-bottom: thin dotted #675c47;
}
/* ul {
background-color: #efe5d0;
增加背景颜色,内边距和外边距
下外边距为0,因为表格显示中上方已经有10像素的边框距离border-spacing
margin: 10px 10px 0px 10px;
padding:5px 0px 5px 0px;
list-style-type: none; 删除列表前小标志
}
ul li{
display: inline; 列表项的前后不会再有换行,像常规的内联元素一样在页面上流入一行
padding: 5px 10px 5px 10px;
}
ul li a:link, ul li a:visited {
color: #954b4b;
border-bottom: none;
font-weight: bold; 粗体,默认值为normal
}
ul li.selected {
background-color: #c8b99c;
} */
/*为了让CSS更特定, 我们使用nav元素来指定样式*/
nav {
background-color: #efe5d0;
margin: 10px 10px 0px 10px;
}
nav ul {
list-style-type: none;
padding: 5px 0px 5px 0px;
}
nav ul li {
display: inline;
padding: 5px 10px 5px 10px;
}
nav ul li a:link, nav ul li a:visited {
color: #954b4b;
border-bottom: none;
font-weight: bold;
}
nav ul li.selected {
background-color: #c8b99c;
}
下面分享几个前端学习的网址:
https://en.wikipedia.org/wiki/
http://www.w3school.com.cn/
http://www.runoob.com/