HomeWeb utilitiesHTMLHTML link code
HTML reference

HTML link code

How to write HTML link code.

How to write HTML link code.

HTML text link

Text Link

The code will create this link:

Text Link

HTML link to same page

Anchor link code:

Link code generator

The code will create this link:

Link code generator

								When pressing the link the browser will jump to the heading below, with this code:


							

Link code generator

HTML image link

Flower

The code will create this link:

								[![diagram](/web/html/link/flower.jpg)](link/html-image-link.htm)
							


							

							

HTML e-mail link

Send Mail

The code will create this link:

Send Mail

See: HTML mailto link.

HTML link to file download

Download File

The code will create this link:

Download File

See: HTML download link

HTML link open in new window

This link will open in new window or tab:

Open page in new window

The code will create this link:

								[Open page in new window](link/html-text-link.htm)
							


							

							

HTML button link

Without javascript:

								<form action="link/html-button-link.htm">
 <input type="submit" value="A button link">
								

With javascript:

Link color

Changing link color is done with css styling:

Link color page

The code will generate this link:

Link color page

Changing link background color is done with css styling:

Link color page

The code will generate this link:

Link color page

Relative vs. absolute path links

This is a link with relative path URL:

Text Link

The code will generate this link:

Text Link

This is a link with absolute path URL:

Text Link

The code will generate this link:

Text Link

HTML link code generator

Select link type:

														Text link
														Image link
														Email link
														Named anchor link
													
										
									
									
										Enter link text:
										 
										 
									
									
										
									
									
										Enter URL to link to:
										 
										 
									
									
										
									
									
										Set CSS link style:
										 
										 
									
									
										Normal link:
										 
										 
									
									
										color:
										
											
														- hex code -
														Aqua
														Black
														Blue
														Fuchsia
														Gray
														Green
														Lime
														Magenta
														Maroon
														Navy
														Olive
														Purple
														Red
														Silver
														Teal
														White
														Yellow
													
										
										
											
										
									
									
										background-color:
										
											
														- hex code -
														Aqua
														Black
														Blue
														Fuchsia
														Gray
														Green
														Lime
														Magenta
														Maroon
														Navy
														Olive
														Purple
														Red
														Silver
														Teal
														White
														Yellow
													
										
										
											
										
									
									
										text-decoration:
										
											
														underline
														none
													
										
										 
									
									
										target-new:
										
											
														none
														tab
														window
													
										
										 
									
									
										Hovered link:
										 
										 
									
									
										color:
										
											
															- hex code -
															Aqua
															Black
															Blue
															Fuchsia
															Gray
															Green
															Lime
															Magenta
															Maroon
															Navy
															Olive
															Purple
															Red
															Silver
															Teal
															White
															Yellow
														
										
											
										
									
									
										background-color:
										
											
														- hex code -
														Aqua
														Black
														Blue
														Fuchsia
														Gray
														Green
														Lime
														Magenta
														Maroon
														Navy
														Olive
														Purple
														Red
														Silver
														Teal
														White
														Yellow
													
										
											
										
									
									
										text-decoration:
										
											
														underline
														none
													
										
										 
									
									
										target-new:
										
											
														none
														tab
														window
													
										
										 
									
									
										
											
											
										
									
									
										Generated link view: