Style properties in HTML

To define the style for the element in HTML, we use the style attribute, which has the following structure.

 
  1. dactinh is the property (property) of CSS
  2. giri is the value of CSS

See also: How to use CSS to style HTML pages

Background color in HTML

The background-color is used to define the background color for elements in HTML. This is an example of setting a blue background color for the page.

y style='background-color:powderblue;'> y style = 'background-color: powderblue;'>

Quản trị mạng Network administrator


Network administrator

 

Text color in HTML

The color feature is used to define the font color for elements in HTML.

n học HTML


Paragraph h

 Read the HTML text color. 

Font in HTML

The font-family is used to define the font used for HTML elements.

Learn HTML trên Quản trị mạng.


Study HT

 ML on Network Administrator. 

Font size in HTML

The font-size is used to define the font size for HTML elements.

Học HTML trên Quản trị mạng.


They

 c font size in HTML on Network Administrator. 

Align text in HTML

The text-align is used to align text for elements in HTML.

Văn bản nằm giữa trang. Text is in the middle of the page.


Text is in the middle of the page.

Style properties in HTML Picture 1
Show all the above code on Chrome browser

Last lesson: Text in HTML

The following article: Format text in HTML

4 ★ | 1 Vote

May be interested

  • 5 steps to learn a dynamic HTML web component profile5 steps to learn a dynamic HTML web component profile
    html is an important part of websites we still use every day. however, not everyone can understand how a website is structured.
  • Basic examples of HTMLBasic examples of HTML
    in the previous html lesson, you know which tools to use to write html code, how to save and open html files. this article will give some basic examples of html text.
  • eQuiz - Multiple choice test on HTML knowledgeeQuiz - Multiple choice test on HTML knowledge
    in this test, we will proceed with the small html test, there will be 30 questions in total with no response time, you must choose the answer in each question. can continue to the next sentence.
  • How to insert CSS to create styles for HTML pagesHow to insert CSS to create styles for HTML pages
    when the browser reads the format file (stylesheet), it will format the html text according to the information in that format file.
  • ID selector in CSSID selector in CSS
    in css, id is used to style the element with the specified id.
  • Why write neat and organized HTML?Why write neat and organized HTML?
    you will get many benefits from writing clean and precise html code. here's why it's a good idea to write optimal html code.
  • HTML formHTML form
    the form in html contains form elements - the element types that take input data such as filling in text fields, checkboxes, buttons, submit buttons ...
  • Text in HTMLText in HTML
    the element in html is used to define a paragraph of text.
  • Elements in HTMLElements in HTML
    the html element usually goes in pairs, including the opening tag, closing tag, and the content inside the two tags.
  • Symbol - Icon in HTMLSymbol - Icon in HTML
    html has many mathematical, technical and monetary symbols that cannot be used to write.