Home / the Internet / Web design / How to change the font of a link

How to change the font of a link


Changing link display options in htmlCan be produced using cascading style sheets css. They allow you to customize the display of the font of the link, its color before the user clicks on it and after clicking the mouse.

Also you can change the font headset and its size.



To set link parameters in css, useClasses and pseudo-classes. The a: link pseudo-class sets the style for a regular link, a: visited gives you the ability to customize the display of an already used link. A: active processes the parameters of the & lt-a> tag when the cursor is clicked on an element, and a: hover specifies the style of the link when it is hovered over it. You can also create any class for the item yourself, and use standard operators to format the text in the parameters.


To turn off the text underline displayLinks in the browser use the text-decoration: none parameter. You can specify this attribute in both the class and the pseudo-class for the & lt-a> element. To change the color of the link, use the color parameter, for size - the standard font-size attribute. If you want to include a boldface font or italics, use the font-weight option.


Open your html file with anyThe text editor that you use to edit the page code. After that, go to the & lt-head> & lt- / head> section of your document and set the css code to the future links on the page using the & lt-style> & lt- / style> descriptor. For example:

& Lt-head>
& Lt-title> Edit links & lt- / title>
& Lt-style type = "text / css">
A: link {text-decoration: none-
Font-size: 14px-
Font-weight: bold-
Color: red-}
& Lt- / style>
& Lt- / head>


In this code, you remove from the usualLinks of the underline, setting the size of the text to 14 pixels, the application of the bold style of the outline and the red color of the element. Now any link in the & lt-a> tag will be displayed in this form.


You can specify a style for each specific link using the css classes. Thus, if the code in the & lt-style> & lt- / style> tag looks like this:

A.link1 {font-size: 20px- color: black-}


You can set the size of 20 pixels and the black color of the link by using the class in the body of the document as follows:

& Lt-a href = "link path" class = "link1"> Link & lt- / a>

It is clear from the example that the link was assignedA step backwards the css class of the code by specifying the class attribute of the link & lt-a>. Now this link will be displayed in black and have a size of 20 pixels. To change this attribute, correct the css code in the & lt- head> & lt- / head> section of the page.


Changing the appearance of the link is completed, you can save the changes made to the file and run it for viewing in the browser.

How to change the font of a link Was last modified: June 20th, 2017 By Dinjeotr
It is main inner container footer text