Welcome to Advanced GIS, Lecture 5
This is a web page that can be viewed as slides.
→ to move forward
← to go back
Class 5
<a>
tag for?<ul>
<li>something</li>
<li>something else</li>
<li>oh and another thing</li>
</ul>
<ul>
<li>something</li>
<li>something else</li>
<li>oh and another thing</li>
</ul>
target="_blank"
<a href="https://www.airbnb.com/rooms/{{id}}"
target="_blank">{{name}}</a>
#layer {
line-color: #ae8;
line-width: 0.5;
polygon-opacity: 1;
polygon-fill: #ae8;
}
a {
color: blue;
font-size: 20px;
}
a {
color: blue;
font-size: 20px;
}
pick the a
elements (links)
a {
color: blue;
font-size: 20px;
}
make the elements blue
a {
color: blue;
font-size: 20px;
}
make the font 20 pixels large
head
<link rel="stylesheet" href="/style.css" />
head
<link rel="stylesheet" href="/style.css" />
<!doctype html>
<html>
<head>
</head>
<body>
</body>
</html>
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="/style.css" />
</head>
<body>
</body>
</html>
<p>
<a href="...">Link One</a>
</p>
<p>
<a href="...">Link Two</a>
</p>
<a href="...">Link Three</a>
a {
color: blue;
font-size: 20px;
}
<p>
<a href="...">Link One</a>
</p>
<p>
<a href="...">Link Two</a>
</p>
<a href="...">Link Three</a>
a {
color: blue;
font-size: 20px;
}
body {
...
}
body
(the whole page)p {
...
}
p
elements (paragraphs)selector {
property: value;
...
}
(use -left
, -bottom
, -right
, -top
)
.box {
margin: 100px;
margin-left: 200px;
}
<div>
s (and others) are block elements<span>
s (and others) are inline elements<span class="legend-label">
land use vacant
</span>
<span class="legend-label">
land use vacant
</span>
(in the CSS):
.legend-label {
font-weight: bold;
}
<span class="legend-label legend-label-vacant">
land use vacant
</span>
<span class="legend-label legend-label-vacant">
land use vacant
</span>
<span class="legend-label legend-label-vacant">
land use vacant
</span>
<span class="legend-label">
land use vacant
<a href="...">more info</a>
</span>
<span class="legend-label">
land use vacant
<a href="...">more info</a>
</span>
what if we want to style a
elements only if they are in elements of class legend-label
?
<span class="legend-label">
land use vacant
<a href="...">more info</a>
</span>
a {
...
}
would style all links
<span class="legend-label">
land use vacant
<a href="...">more info</a>
</span>
.legend-label {
...
}
would style too much, too
<span class="legend-label">
land use vacant
<a href="...">more info</a>
</span>
.legend-label a {
...
}
<span class="legend-label">
land use vacant
<a href="...">more info</a>
</span>
.legend-label a {
...
}
"style the a
elements in elements with class legend-label
"
it doesn't matter how far inside the a
element is:
<span class="legend-label">
land use vacant
<div>
<div>
<div class="source">
<a href="...">more info</a>
</div>
</div>
</div>
</span>
and you can combine more selectors if it makes sense
.legend-label .source a {
...
}
.legend-label .source a {
...
}
as with CartoCSS, the last style wins
a {
color: blue;
font-size: 20px;
}
a {
color: red;
}
not very specific:
div {
...
}
more specific:
.main-content {
...
}
even more specific:
div .main-content {
...
}
<p>
a special paragraph
</p>
<p style="font-size: 100px;">
a special paragraph
</p>
<p style="font-size: 100px; color: pink; margin-top: 50px;">
a special paragraph
</p>
(1) try out a change in developer tools, then copy and paste it to your file
(2) comment things out rather than delete them
(2) comment things out rather than delete them:
a {
/* Trying out a new color */
/*color: blue;*/
color: rgb(88, 18, 209);
...
}
@media (max-width: 600px) {
body {
margin: 0;
padding: 0;
}
.column-right h2 {
display: none;
}
}