The first step would be to go to the <head></head>
section. At the bottom make a new <style></style>
tag for your custom CSS styling.
To align a piece of text on a slide in reveal.js
Create a new class called left.
.left { }
Inside your class, put text-align: left;
. Your code should look like this:
<style>
.left {
text-align: left;
}
</style>
In your HTML, add the left
class to any of your elements. Eg.
<section class="left">Slide 1</section>
Or:
<section>
I'm just normal text.
<p class="left">But I'm not!</p>
</section>
Change the font size of an element in reveal.js
The first thing to do is create a new class as we did for aligning text.
<head>
<!-- Custom Styles For Our Presentation -->
<style>
.left {
text-align: left;
}
.size {
}
</style>
</head>
Then add the following:
font-size: /*custom font size*/;
You can change the size there. CSS also has some built-in styles for this such as large
, medium
and small
.
After that, just add the class to your chosen elements. You can also add to classes to one element like this: <section class="left size">Slide 1</section>
.
Your finishing code could be something like this:
<head>
<!-- Custom Styles For Our Presentation -->
<style>
.left {
text-align: left;
}
.size {
font-size: 80px;
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section class="left size">Slide 1</section>
<section>Slide 2 <p class="left">Text aligned left</p></section>
</div>
</div>
</body>
(:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…