< >
<p>, <span>)
<div>
)
<!-- /exercises/01-intro-to-html.html -->
<!DOCTYPE html>
<html>
<head>
<title>A basic web page</title>
</head>
<body>
<div>
<span>Here is some text</span>
</div>
</body>
</html>
<nav>
, <footer>
, <audio>
/* Elements by tag */
p {
color: #000000;
}
/* Elements by tag and class name (using the . identifier) */
div.content-container {
background: #121212;
}
/* Elements by tag and id (using the # identifier) */
span#my-custom-span {
font-family: "Apercu-Pro", sans-serif;
font-size: 12px;
}
/* Child elements of a specific element */
ul#my-custom-list > li {
list-style-type: none;
}
<!-- /exercises/02-inline-css.html -->
<!DOCTYPE html>
<html>
<head>
<title>Inline CSS</title>
</head>
<body>
<div style="background-color: #000000; padding: 20px;">
<p style="color: #c383f2; text-transform:uppercase; font-size: 36px;">
Here is my styled paragraph inside a styled div.
</p>
</div>
</body>
</html>
<!-- /exercises/03-internal-css.html -->
<!DOCTYPE html>
<html>
<head>
<title>Internal CSS</title>
<style>
.my-custom-div {
background-color: #000000;
padding: 20px;
}
.my-custom-paragraph {
color: #c383f2;
text-transform: uppercase;
font-size: 36px;
}
</style>
</head>
<body>
<div class="my-custom-div">
<p class="my-custom-paragraph">
Here is my styled paragraph inside a styled div.
</p>
</div>
</body>
</html>
<!-- /exercises/04-external-css.html -->
<!DOCTYPE html>
<html>
<head>
<title>External CSS</title>
<link rel="stylesheet" href="../css/04-style.css">
</head>
<body>
<div class="my-custom-div">
<p class="my-custom-paragraph">
Here is my styled paragraph inside a styled div.
</p>
</div>
</body>
</html>
/* css/04-style.css */
.my-custom-div {
background-color: #000000;
padding: 20px;
}
.my-custom-paragraph {
color: #c383f2;
text-transform: uppercase;
font-size: 36px;
}
<!-- /exercises/05-positioning.html -->
<!DOCTYPE html>
<html>
<head>
<title>CSS Positioning</title>
<link rel="stylesheet" href="../css/05-positioning.css">
</head>
<body>
<div class="first-div">Hi I'm first div!</div>
<div class="second-div">
<div class="inner-div">Hi I'm the inner div!</div>
Hi I'm second div!
</div>
</body>
</html>
/* css/0-positioning.css */
.first-div {
color: #bbbbbb;
background-color: #000000;
width: 40vw;
height: 40vh;
}
.inner-div {
position: relative;
background-color: #e374cd;
width: 40%;
height: 40%;
left: 60%;
}
.second-div {
position: relative;
background-color: #354dc4;
width: 40vw;
height: 40vh;
}
margin
& padding
?
cmd + option + i
red
, blue
, yellow
, black
width: 400px; height: 400px;
border-right: 8px solid black;
) increases div dimensions by default
box-sizing: border-box;
<div id="anim-circles-container">
<div id="circle-1" class="anim-circle"></div>
<div id="circle-2" class="anim-circle"></div>
<div id="circle-3" class="anim-circle"></div>
<div id="circle-4" class="anim-circle"></div>
<div id="circle-5" class="anim-circle"></div>
</div>
div.anim-circle {
width: 40px;
height: 40px;
border-radius: 50%;
opacity: 0.7;
position: absolute;
}
div#circle-1 { animation: my-animation 2s ease 0s infinite alternate; }
div#circle-2 { animation: my-animation 2s linear 0s infinite alternate; }
div#circle-3 { animation: my-animation 2s ease-in 0s infinite alternate; }
div#circle-4 { animation: my-animation 2s ease-out 0s infinite alternate; }
div#circle-5 { animation: my-animation 2s ease-in-out 0s infinite alternate; }
@keyframes my-animation {
0% { background: #FFA500; left: 10%; }
100% { background: #00caff; left: 90%; }
}
/* more css in example code */
@keyframes roundandround {
to { transform: rotateX(360deg) rotateY(360deg); }
}
.wrapper {
transform: rotateX(45deg) rotateY(180deg);
transform-style: preserve-3d;
}
.ball {
transform-style: preserve-3d;
animation: roundandround 4s 1.3s infinite linear;
}
.ball .ring {
border: 4px;
border-style: dotted;
border-radius: 50%;
opacity: 1;
animation: show 0.75s forwards ease-in-out;
color: #7ea6ff;
}
.ring:nth-child(1) {
transform: rotateY(4deg);
animation-delay: 0s;
}
.ring:nth-child(2) {
transform: rotateY(8deg);
animation-delay: 0.1s;
}
git --version
)