Restart your R session Ctrl + Shift + F10
Open 06-intro-css/06-start.Rmd
.pull-left[].pull-right[Lemurs are the cutest.].footnote[Duke Lemur Center]
You've probably encountered remark's dot-name-bracket notation before.
The most common examples in the default slides are .pull-left[]
, .pull-right[]
and .footnote[]
.
We can use this syntax to modify the appearance or position of the text in our slides.
And most importantly, we can create our own versions.
Launch infinite_moon_reader()
Put .big[ ]
around just a few words on the slide
01:00
---class: center middleLemurs are the .big[most endangered] mammals on Earth
Your slide source code probably looks like this now
Lemurs are the most endangered mammals on Earth
Lemurs are the most endangered mammals on Earth
Open the slides in your browser
Open the slides in Chrome or Firefox.
Right click on the embiggened words and select Inspect Element
What rules are being applied to this element?
Adjust font-size
rule of the .big
class
Set the color
to your favorite color.
Here are a few to try:
DeepPink
CornFlowerBlue
RosyBrown
SeaGreen
Find another property to change.
Try typing font-
and pressing Tab
01:00
Right Click on the rule and select Copy Rule
Paste the rule into extra.css
and save to update
Follow the pattern from .big
to write your own rule called .fade
opacity
to 0.66
Then, put .fade[]
around the lemur image
02:00
Follow the pattern from .big
to write your own rule called .fade
opacity
to 0.66
Then, put .fade[]
around the lemur image
02:00
.fade { opacity: 0.66;}
.fade[]
selector {
property: value;
property: value;
}
.big {
font-size: 2em;
color: CornFlowerBlue;
}
.pull-right[Lemurs are .big[the cutest].]
Lemurs are the cutest
.pull-right[Lemurs are .big[the cutest]]
Lemurs are the cutest
Inline elements are like inline R code. They modify a small snippet of text
.pull-right[Lemurs are .big[the cutest].]
Block elements are like R code chunks. They're a whole chunk of something.
.pull-right[Lemurs are .big[the cutest].]
Lemurs are the cutest.
Inspect the output
Let's see how xaringan and remark render the markdown on the left.
<div class="pull-right"> <p> Lemurs are <span class="big"> the cutest </span>. </p></div>
Lemurs are the cutest.
In the HTML we see the .pull-right
is used for a <div>
tag (block element)
and the .pull-left
is used for a <span>
tag (inline element).
The second slide contains a figure, using the knitr::fig_chunk()
trick we learned earlier.
With infinite_moon_reader()
running...
Add a <style>
tag to the slide markdown
<style></style>
In the next task, write you CSS inside the <style>
tag.
The slides will update live!
Put the figure in a .bottom-right[]
.
Create a new CSS rule in extra.css
called .bottom-right
Set the position
property to absolute
Set the width
and height
properties
200px
or 450px
Set the bottom
and right
properties to a CSS distance
1.5em
or 2em
Bonus Give the plot a border
03:00
.bottom-right { position: absolute; bottom: 1.5em; right: 2em; width: 450px; height: 200px; border: 2px solid gray;}
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
o | Tile View: Overview of Slides |
Esc | Back to slideshow |
Restart your R session Ctrl + Shift + F10
Open 06-intro-css/06-start.Rmd
.pull-left[].pull-right[Lemurs are the cutest.].footnote[Duke Lemur Center]
You've probably encountered remark's dot-name-bracket notation before.
The most common examples in the default slides are .pull-left[]
, .pull-right[]
and .footnote[]
.
We can use this syntax to modify the appearance or position of the text in our slides.
And most importantly, we can create our own versions.
Launch infinite_moon_reader()
Put .big[ ]
around just a few words on the slide
01:00
---class: center middleLemurs are the .big[most endangered] mammals on Earth
Your slide source code probably looks like this now
Lemurs are the most endangered mammals on Earth
Lemurs are the most endangered mammals on Earth
Open the slides in your browser
Open the slides in Chrome or Firefox.
Right click on the embiggened words and select Inspect Element
What rules are being applied to this element?
Adjust font-size
rule of the .big
class
Set the color
to your favorite color.
Here are a few to try:
DeepPink
CornFlowerBlue
RosyBrown
SeaGreen
Find another property to change.
Try typing font-
and pressing Tab
01:00
Right Click on the rule and select Copy Rule
Paste the rule into extra.css
and save to update
Follow the pattern from .big
to write your own rule called .fade
opacity
to 0.66
Then, put .fade[]
around the lemur image
02:00
Follow the pattern from .big
to write your own rule called .fade
opacity
to 0.66
Then, put .fade[]
around the lemur image
02:00
.fade { opacity: 0.66;}
.fade[]
selector {
property: value;
property: value;
}
.big {
font-size: 2em;
color: CornFlowerBlue;
}
.pull-right[Lemurs are .big[the cutest].]
Lemurs are the cutest
.pull-right[Lemurs are .big[the cutest]]
Lemurs are the cutest
Inline elements are like inline R code. They modify a small snippet of text
.pull-right[Lemurs are .big[the cutest].]
Block elements are like R code chunks. They're a whole chunk of something.
.pull-right[Lemurs are .big[the cutest].]
Lemurs are the cutest.
Inspect the output
Let's see how xaringan and remark render the markdown on the left.
<div class="pull-right"> <p> Lemurs are <span class="big"> the cutest </span>. </p></div>
Lemurs are the cutest.
In the HTML we see the .pull-right
is used for a <div>
tag (block element)
and the .pull-left
is used for a <span>
tag (inline element).
The second slide contains a figure, using the knitr::fig_chunk()
trick we learned earlier.
With infinite_moon_reader()
running...
Add a <style>
tag to the slide markdown
<style></style>
In the next task, write you CSS inside the <style>
tag.
The slides will update live!
Put the figure in a .bottom-right[]
.
Create a new CSS rule in extra.css
called .bottom-right
Set the position
property to absolute
Set the width
and height
properties
200px
or 450px
Set the bottom
and right
properties to a CSS distance
1.5em
or 2em
Bonus Give the plot a border
03:00
.bottom-right { position: absolute; bottom: 1.5em; right: 2em; width: 450px; height: 200px; border: 2px solid gray;}