Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
The figure element just for representing figures in a document. Let's take a look at how this works. I'm going to go working copy of scissors.html. I'll call this -working, and I'm going to open it up in my text editor, and I'm going to also open it up in the browser. So here's our scissors document, and let's go ahead and add another illustration. So I'm going to come down here in the stories of scissors, and I'm going to come down to the second paragraph, and I'm going to add a figure here.
So you are usually going to want to do that with the figure. In this case we're not actually using that. But we do have this set up in CSS a little bit, and we'll look at that in a moment. For now let's go ahead and reload our page, and you see there's figure. And it's all nicely formatted with CSS. We see, there's our caption and everything, and it all looks exactly like we would like it to look. So let's go ahead and look at the CSS for this. That's in rps.css. And we are going to come down here, and there's figure.
So all of the figures in the document will have this border and the padding and the background color and all of that, and you can see we actually have a little bit of a lighter cream-colored background color to set it apart from the background of the document. And we have this border around it, and we have the .left class selector to tell it to float left. We can have them float right if we want. That wouldn't work well here because we have something else over there. Then we format the fig caption, and it's as simple as that.
Give it a font-family, font-size, center, and padding, just like we would any other text in CSS. So you can see that formatting this is really simple, just like any other CSS in your document, and the figure element is for representing figures in your document. Use this for illustrations, diagrams, photos, or any other content that's illustrative in nature and perhaps uses a caption.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 98353 Viewers
61 Video lessons · 85643 Viewers
71 Video lessons · 69584 Viewers
56 Video lessons · 101916 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.