Learn links in CSS, syntax and examples


In the previous CSS lesson, Taimienphi.vn introduced you to images in images. In the next lesson below, Taimienphi.vn will introduce you to the link in CSS.


By editing the CSS properties (including color, font-family, background, …) we can create and edit links as we wish. Refer to the article link in CSS Below of Taimienphi.vn to find out detailed information.

Learn links in CSS

Table of Contents:
1. Link in CSS
2. Text-decoration property in CSS
3. Background-Color property
4. Link Button in CSS.

1. Link in CSS

To set different link states, we can use the following properties:
a: link – The link has not been accessed.
a: visited – the link the user has accessed.
a: hover – link when user hovers over the mouse
a: active – The link works when the user clicks.

For example:

link in css

The output will look like:

link in css 2

When setting the style for status links, we need to note the following rules:

a: hover must follow status a: link and a: visited.

a: active must follow status a: hover.

2. Text-decoration property in CSS

Properties text-decoration In CSS it is used to delete the underlines in each link.

For example:

link in css 3

The output will look like:

link in css 4

3. Background-Color property

Properties background-color Used to set the background color for links in CSS.

For example:

link in css 5

The output will look like:

link in css 6

4. Link Button in CSS.

For example: The following illustrates how to combine several CSS properties to display links in the form of boxes or buttons:

link in css 7

The output will look like:

link in css 8

https://thuthuat.taimienphi.vn/link-trong-css-49088n.aspx
The above lesson Taimienphi.vn has just introduced you to the link in CSS. In the next CSS lessons Taimienphi.vn will introduce you more about properties Format tables in CSS. If you have any questions, you can comment on the article below so that Taimienphi.vn can help you learn CSS better.

.

Add a Comment

Your email address will not be published. Required fields are marked *