You've seen one, surely – a neat little list of links to social media, products, and other web content that can easily be shared via URL. Whether you're an influencer, artist, or just wanting a place to collect your work, Linktree is a popular option for sharing user media, but their advanced customizable features can become costly, and outsourcing your bio means less clicks directly to your own content. In this tutorial, we'll teach you how to create your very own version of a Linktree landing page for FREE, and options to spiff it up nicely too!
Sample Project: http://freecodinglessons.com/foundations/1.3/
TIP: Go to the above page, click "View Activity 1 Solution", then right click anywhere and select "Inspect". This will show you all of the HTML and CSS used to build the page – hovering over the elements will also highlight their corresponding visuals on the page. Use this if you get lost or need some help!
Examine the following:
<h1>Hey there! 👋</h1>
<p>I'm a web designer who's always excited for the next project. Instead of
having my "link in bio", I keep links for all my work here.</p>
<p>💼 Read the testimonials given by my past clients on my LinkedIn page:</p>
<p>💻 Follow me on Twitter for coding tips:</p>
<p>📷 Follow my photography on Instagram:</p>
<p>🖌️ I also paint. Order prints of my most recent work on deviantART:</p>
<p>🚀 If you want to work with me, contact me on LinkedIn with your project
idea and I can give you a quote. I'm looking forward to helping you launch your
next web project!</p>
This code represents the HTML needed to get most of the basic structure of your personal Linktree replacement. Copy and paste the code into your code editor and save it as a new HTML document, such as "project1.html". Then simply open the file in your browser to see the result!
Styles, such as fonts and colors, are key to creating a unique look for your site. Checkout the code below:
<style>
body {
margin: auto;
width: 300px;
background: WhiteSmoke;
}
p {
color: DarkSlateGray;
padding-top: 20px;
}
</style>
This will do some simple formatting of your text to narrow the text area and add some space between sections (replicating Linktree's narrow mobile-friendly look), as well as set the color of the background and paragraph font. Copy and paste this block into your HTML document, above any existing code. Try playing around with different colors until you are satisfied with the result.
Now it's time for the star of the show – the links! Consider the following code:
<a href="#">LinkedIn</a>
<a href="#">Twitter</a>
<a href="#">Instagram</a>
<a href="#">deviantART</a>
You'll notice there are no actual URLs listed just yet. Instead, we are using a placeholder character #
– this is a common coding technique when you haven't finalized what you're linking to yet. Copy and paste each anchor tag below it's corresponding paragraph text, like so:
<p>💼 Read the testimonials given by my past clients on my LinkedIn page:</p>
<a href="#">LinkedIn</a>
Now that we have our text and links all laid out, let's add some polish to the links themselves. Take a look at the following styles:
<style>
a {
background: PaleGreen;
color: DarkSlateGray;
padding: 10px;
text-decoration: none;
}
</style>
Copy and paste the anchor tag styles into your existing style tag. These will give a nice pleasant pale green background padded out to 10px, giving it the look and feel of a button – note that you can click on the colored background without text present and it will still open the link. This replicates Linktree's buttons and makes the links more accessible by being easier to see and click – much better than a simple hyperlink! Play with the colors and sizing here until it suits your vision.
Now that you have a functional Linktree replacement, all that's left to do is add your own socials and links! Change the project text to your liking, replace the # placeholders, add more sections, try out different sizing, colors and structure. And, read on for more ideas on where to take your project next!
Mish (they/them) is a Kickstart Coding alum, having completed the fullstack program in Spring 2020. While primarily a PHP and MySQL developer, Mish also excels at Python, Lua, MongoDB, Django, React and other more modern stacks and frameworks. When not writing up an article for the newsletter or fielding students' code questions, you can find them tinkering with appliances in their house, playing the latest spooky video game, or binging some classic Star Trek content.