CSS Example: Text-Indent Property
<title>Example</title>
<style>
p {
font-size: 5vw;
text-indent: 10vw;
color: tomato;
}
</style>
<p>The first line of this text has been indented. The rest of the text is rendered without the indent.</p>
<p>Then, when the next paragraph comes along, the first line is indented again.</p>
In this example, the left side provides the code used to render the output in the right side.
Feel free to copy and paste the code into your own project and modify as you wish.
About CSS
CSS stands for Cascading Style Sheets. It's used to add styles to web pages. It's typically added to HTML pages using the <link>
tag, so that we can have the CSS in a separate file to the HTML file. However, we also have the option of embedding the CSS in the actual HTML file by using the <style>
HTML tag, or by using the style
attribute within an individual HTML tag.