How to Insert Line Break in CSS
In this tutorial we will see how to apply CSS line breaks in web pages.
Don’t forget to check out our site for more free how-to videos!
– our feed
– join us on facebook
– our group in Google+
Apart from text editors or documentation applications, breaking line is not as straight-forward in web pages, as a piece of code is required in the source code for this purpose. The methodology used for this is called “Line Break”.
Follow this step by step easy tutorial to learn how to apply line breaks in CSS and see how to use span tag.
Step 1 – Text within Span tags
First of all, open up the paragraph tag first. After that, let’s open up the Span tag and insert some text in it. With that done, let’s close the Span tag and repeat the process so that we have two lines being displayed on the page.
The code for that would be:
‘span’This is some Text’/span”span’This text is required on Next Line’/span’
Step 2 – Defining the Span Class
With that done, let’s close the paragraph tag and open up the style tag before the body tag,
Now let us define the functionality of the span tag so that it is displayed as a block-level element.
Line break in CSS is done by specifying a display style of element as block, which means that whatever element or text comes in between the span class, it will display that as a separate block, which will be interpreted as line break in viewing.
The code will be:
Step 3 – Line Break between texts
It can be observed that line break has appeared between the Lines. This is actually because of that span class which has been discussed in detail in previous step.
Xem thêm Bài Viết:
- Chia sẻ đầy đủ về cách hướng dẫn Ghost Win Xp bằng USB cơ bản từ A tới Z
- Hướng dẫn tạo file ghost win 10 thông qua 3 bước đơn giản mà bạn không nên bỏ qua
- Mách bạn 4 bước trong cách bung file tib theo chuẩn UEFI đơn giản nhất
- Mật bí 4 kiểu hyperlink trong excel bị lỗi phổ biến mà bạn hay gặp nhất
- Khái niệm ma alt là gì và cách sử dụng bảng mã ATL như thế nào?