<div id="container">
<div id="sub-div"> // Has own styles + #container styles
<p id="block"> // Own styles + #sub-div + #container
<text>Text1</text> // styles + #block + #sub-div + #container
<text>Text2</text>
<text>Text3</text>
</p>
</div>
</div>
<div style="font-size:30px">Text goes here</div>
<html>
<style>
**** CSS syntax goes here ****
</style>
</html>
<html>
<link rel="stylesheet" href="css/my-css.css"/>
</html>
<div id="my-div" class="container">...</div>
/* CSS pseudo-code */
selector {
property:value;
}
li { /* all <li> elements */
property:value;
}
.my-class { /* with the . symbol */
property:value;
}
#my-id { /* with the # symbol */
property:value;
}
<div>Block element</div>
<div>Block element</div>
<span>Inline element</span>
<span>Other inline element</span>
#element {
position:fixed;
}
#element {
position:absolute;
}
#element {
position:relative;
}
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head;-->
</head>
/* In CSS stylesheet */
@import url(https://..../bootstrap.min.css);
Column 1
Column 2
Column 3
Row 1
Row 2
Row 1:
Row 2:
Row 3:
<body>
<div class="container">
<div class="row">
<div class="col-md-6">6 columns on a medium screen</div>
<div class="col-md-6">6 columns on a medium screen</div>
</div>
</div>
</body>
@media screen and (max-width: 300px) {
body {
background-color: lightblue;
}
}
<nav class="navbar navbar-default">
<div class="container">
<!-- Header for mobile -->
<div class="navbar-header">
....
</div>
<!-- Screen navigation elements -->
<div id="navbar" class="navbar-collapse collapse">
...
</div>
</nav>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>