How to center text in HTML : know how to align text

How to center text in HTML: There are a lot of ways using which you can center your text in HTML documents. To align your text in the center you can use any methods we have mentioned below.

When you write anything inside h1, div, p tags sometimes you need to center the text especially in the case of heading. So to make the text display in the center you can always use CSS or align tag.

What is CSS and how many types are there?

CSS (Cascading Style Sheet) is used to design HTML pages and make it attractive. Using CSS we can align the text, give margin, border, color, height, width and many things. In simple words Without CSS a web page is just like a skeleton.

Types of CSS:

Inline CSS: Inline CSS is used to write in the line and that will get higher priority than internal and external. Inline CSS can be used in heading, Paragraph, Section or any div tags.

Internal CSS: Internal CSS is written on the same page inside the head tag. If you want to use internal CSS      then you need to write <style > tag inside the head. Inside style tag just use a selector to manipulate the design of the entire pages.

External CSS: For professional websites using external CSS is a wise idea. External CSS is a completely different page where all the code of CSS you can write. External CSS have lot of advantages compared to other types. You can use external pages using a link tag in your page.



Leave a Comment