Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Let's take a look at how XHTML and HTML handle paragraphs in a document. Here we have a document in our text editor, the top window is the text editor, the bottom window here is the browser and this document has a paragraph in it. It has two paragraphs actually. This paragraph here and let me scroll down so you can see the whole thing and this paragraph over here. Now you will notice that the paragraphs are enclosed in p tags. The p tag is for paragraph and the p tag is a container. So it has content.
The content of the container is the paragraph itself and it has a begin tag and it has an end tag and that's how a paragraph is formed in XHTML, head HTML. So this paragraph here is displayed in the browser there and this paragraph here is displayed in the browser here. You will notice that the browser makes a nice space between them and formats them as separate paragraphs. So in a nutshell, that's how paragraphs work. Another thing I would like to talk about is how we format the paragraphs in the text editor. You will notice that this paragraph here runs on and it goes way off the screen and sometimes you'll see documents where paragraphs will go on for many, many screens wide, and they work just fine.
That really doesn't have any impact on how it's displayed in the browser. But if you remember, when we add white space like for instance a line break right here, this doesn't really affect how the text is displayed in the browser. I will go ahead and I'll save this with the line break in it. You'll see it breaks after the word words and the comma there, so that would be right there and I'll reload it in the browser and you see that that does not affect how it's displayed in the browser. So what you can do is you can actually reformat this and I'll use a feature in my text editor, most text editors have a feature like this, like we call it a hard wrap or something like that.
In this one, it's called Split lines and it's in the Edit menu there. So I'll go ahead and I'll click on Split lines. It wraps the paragraph around, so that it all fits on the screen here in the Editor. I will go ahead and I'll save that and I'll reload it in the browser. So it has no effect on how it's displayed in the browser, but it makes it readable on the screen here in my text editor. This is something that's just nice to do. It makes it readable in the text editor and makes it a little bit more workable if you have to use it in another environment like in a console on a server or something like that or you just need to make a quick edit when you are some place else and it just makes it easier to work with and it doesn't have any effect on how it's displayed.
So I consider a nice practice, I always wrap my paragraphs so that they fit on the screen in my text editor and they go ahead and work just fine in the browser when I do that.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101837 Viewers
61 Video lessons · 88587 Viewers
71 Video lessons · 72405 Viewers
56 Video lessons · 104101 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.