While you need to construct web sites as a Python programmer, there’s no approach round HTML and CSS.
Nearly each web site on the Web is constructed with HTML markup to construction the web page.
To make a web site look good, you may model HTML with CSS.
For those who’re enthusiastic about internet improvement with Python, then figuring out HTML and CSS will aid you perceive internet frameworks like Django and Flask higher.
However even in the event you’re simply getting began with Python, HTML and CSS can allow you to create small web sites to impress your folks.
You’ll get an introduction to HTML and CSS that you could comply with together with.
All through this tutorial, you’ll construct a web site with three pages and CSS styling:
Whereas creating the online undertaking, you’ll craft a boilerplate HTML doc that you should utilize in your upcoming internet tasks.
You could discover that the supply code will turn out to be useful once you’re engaged on future tasks.
You’ll be able to obtain it right here:
After studying the fundamentals of HTML and CSS, you’ll discover concepts on the way to proceed your journey on the finish of the tutorial.
Create Your First HTML File
Consider any web site that you just’ve lately visited.
Perhaps you learn some information, chatted with mates, or watched a video.
It doesn’t matter what sort of web site it was, you may wager that its supply code has a fundamental <html>
tag originally.
HTML stands for HyperText Markup Language.
HTML was created by Tim Berners-Lee, whose identify may also ring a bell for you because the inventor of the World Wide Web.
The hypertext a part of HTML refers to constructing connections between completely different HTML pages.
With hyperlinks, you may soar between pages and surf the Internet.
You utilize markup to construction content material in a doc.
In distinction to formatting, the markup defines the which means of content material and never the way it appears.
On this part, you’ll study HTML parts and their roles.
Writing semantic HTML code will make your paperwork accessible for a variety of holiday makers.
In any case, you need to allow everyone to eat your content material, whether or not they’re visiting your web page with a browser or utilizing screen reading instruments.
For every HTML ingredient, there’s a normal that defines its meant use.
At present, the requirements of HTML are outlined by the Web Hypertext Application Technology Working Group (WHATWG).
The WHATWG performs an analogous position for HTML because the Python Steering Council does for Python.
Roughly 95 percent of websites use HTML, so that you’ll be hard-pressed to keep away from it if you wish to do any internet improvement work in Python.
On this part, you’ll begin by creating your first HTML file.
You’ll learn to construction your HTML code to make it readable to your browser and for people.
The HTML Doc
On this part, you’ll create a fundamental HTML file.
The HTML file will include the bottom construction that almost all web sites are constructed with.
To start out issues off, create a file named index.html
with some textual content:
1<!-- index.html -->
2
3Am I HTML already?
Historically, the primary file of your web site is named index.html
.
You’ll be able to consider the index.html
web page as akin to the fundamental.py
or app.py
file in a Python undertaking.
Up to now, the one content material of index.html
is a plain Am I HTML already?
string.
You haven’t added any HTML syntax but, besides an HTML remark on line 1.
Much like the Python interpreter not executing feedback in your Python code, the browser gained’t render the contents of your HTML comments.
Nonetheless, go forward and open index.html
in your browser:

Your browser shows the textual content with out complaining.
It appears the browser can deal with an HTML file, even when its solely cue is the extension.
That’s good to know, however this conduct additionally has a draw back.
Browsers will all the time attempt to render HTML paperwork,
even when the HTML syntax of your doc isn’t legitimate.
Very seldomly, the browser itself will present you one thing like a SyntaxError, just like what Python does once you attempt to run invalid code.
This implies that you could be not discover in the event you’ve shipped invalid code, which might trigger points to your web site guests.
Replace index.html
and create a minimal legitimate HTML doc by including the code beneath:
1<!-- index.html -->
2
3<!DOCTYPE html>
4<html lang="en">
5<head>
6 <meta charset="utf-8">
7 <title>Am I HTML already?</title>
8</head>
9</html>
This code is probably the most minimal legitimate HTML doc that you could get away with.
Strictly talking, you might even ditch the lang
attribute in line 4.
However including the fitting language subtag is really useful to declare which pure language your doc comprises.
Observe: On this tutorial, you’ll keep on with English and use the en
language tag.
You’ll be able to go to the official language subtag registry to seek out all the opposite language tags.
The language attribute makes it simpler for translation instruments to work together with your web site and can make your web site extra accessible.
Display readers particularly rely closely on the language declaration of an HTML doc to decide on the fitting language mode for synthesizing the content material.
At its root, any HTML doc that you just construct will most likely comply with the construction of the instance above.
However there’s one essential HTML ingredient lacking.
Open index.html
and add <physique>
beneath <head>
:
1<!-- index.html -->
2
3<!DOCTYPE html>
4<html lang="en">
5<head>
6 <meta charset="utf-8">
7 <title>Am I HTML already?</title>
8</head>
9<physique>
10Sure,<br>I'm!
11</physique>
12</html>
Any legitimate HTML file should begin with a doctype declaration.
On this tutorial, you’ll be utilizing <!DOCTYPE html>
, which tells the browser that the doc comprises HTML5 code and will render your web page in customary mode:
If a browser finds an outdated, incomplete or lacking doctype firstly of the web page, they use “quirks mode”, which is extra backwards suitable with previous practices and previous browsers. (Source)
After the doctype declaration, you might have a gap <html>
tag.
In line 12, you’ll find the corresponding closing </html>
tag.
Most parts in HTML have an opening tag, some content material in between, and a closing tag on the finish.
These components may even be on the identical line, just like the <title>
ingredient in line 7.
Different parts, like <meta>
in line 6, don’t have an identical closing tag, so that they don’t include any content material.
These empty parts are so-called void elements.
They stand independently and should not even include attributes. One such instance is <br>
in line 10, which creates a line break.
HTML tags begin with an angle bracket (<
) and finish with an angle bracket (>
).
The tag names in between the angle brackets are normally fairly descriptive and state what the HTML ingredient is supposed for.
An excellent instance is <title>
in line 7, wherein the content material defines the title of your web page.
The <physique>
block comprises the mass of your content material.
You’ll be able to consider <physique>
because the a part of the HTML doc that you could work together with in your browser.
Generally the tag names are abbreviated, like the road break ingredient <br>
in line 10.
To get an summary of different HTML tag names, go to Mozilla’s HTML elements reference.
When you’ve familiarized your self with the construction of your HTML doc, reload index.html
in your browser and take a look at how your web site appears:

Superior, you’re now displaying the content material of your first correct web site!
There’s probability that you just’ll begin any internet undertaking with a construction just like the one that you just’ve constructed on this part.
To save lots of your self some work sooner or later, you may obtain the HTML boilerplate code by clicking the hyperlink beneath:
Within the subsequent part, you’ll enhance the bottom construction that you just’ve created up to now.
To discover why HTML is named a markup language, you’ll add content material and construction to your web site.
Whitespace and Textual content Formatting
The one markup that your HTML doc has up to now is the bottom skeleton of your web site.
Now it’s time to dive in deeper and construction some actual content material.
To have one thing to work with, add the textual content beneath to the <physique>
block of index.html
:
1<!-- index.html -->
2
3<!DOCTYPE html>
4<html lang="en">
5<head>
6 <meta charset="utf-8">
7 <title>Am I HTML already?</title>
8</head>
9<physique>
10Howdy, World Huge Internet!
11That is my first web site.
12
13About me
14
15I am a Python programmer and a bug collector.
16
17Random information
18
19I do not similar to emoji,
20I really like emoji!
21
22My most-used emoji are:
23 1. 🐞
24 2. 🐍
25 3. 👍
26
27Hyperlinks
28
29My favourite web sites are:
30 * realpython.com
31 * python.org
32 * pypi.org
33</physique>
34</html>
While you open the web site in your browser, it appears that evidently the browser didn’t acknowledge any whitespace in any respect.
Though you distributed your content material on a number of traces inside <physique>
, the browser shows all the things as one steady line:

As a Python developer, you already know that whitespace is an important ingredient in writing beautiful Python code.
The indentation of your Python code makes a distinction in how Python executes your code.
With none extra changes, browsers collapse a number of areas, line breaks, or indentation to at least one area character.
To format your content material in another way, you need to present additional info to the browser.
Go forward and construction index.html
by including HTML tags to your content material:
1<!-- index.html -->
2
3<!DOCTYPE html>
4<html lang="en">
5<head>
6 <meta charset="utf-8">
7 <title>Am I HTML already?</title>
8</head>
9<physique>
10<h1>Howdy, World Huge Internet!</h1>
11<p>That is my first web site.</p>
12
13<h2>About me</h2>
14<p>I am a Python programmer and a bug collector.</p>
15
16<h3>Random information</h3>
17<p>I do not simply <em>like</em> emoji,<br>
18I <robust>love</robust> emoji!</p>
19<p>My most-used emoji are:</p>
20<ol>
21 <li>🐞</li>
22 <li>🐍</li>
23 <li>👍</li>
24</ol>
25
26<h2>Hyperlinks</h2>
27<p>My favourite web sites are:</p>
28<ul>
29 <li>realpython.com</li>
30 <li>python.org</li>
31 <li>pypi.org</li>
32</ul>
33</physique>
34</html>
By wrapping your textual content in HTML blocks, you give the browser extra details about your intentions for the content material.
First, take a look on the HTML parts that wrap greater chunks of textual content:
Line | HTML Component | Description |
---|---|---|
10 | <h1> |
Primary headline of your web site |
11 | <p> |
Paragraph, to construction textual content and associated content material |
13 | <h2> |
Second-level headline, nested beneath <h1> |
16 | <h3> |
Third-level headline, nested beneath <h2> |
20 | <ol> |
Ordered checklist, sometimes rendered as a numbered checklist |
28 | <ul> |
Unordered checklist, sometimes rendered with bullets (• ) |
You’ll be able to nest headline parts six ranges deep.
Whilst you normally solely have one <h1>
ingredient, you will have a number of <h2>
to <h6>
tags.
Headline parts part your HTML doc and are vitally essential for display readers.
For instance, readers might need to soar from headline to headline to navigate your content material.
To put in writing legitimate and accessible HTML, you need to be certain that you don’t skip a headline stage in your code.
You’ll be able to consider the headline tags like doorways that open onto completely different flooring of a constructing.
One ground can have a number of exits to different flooring.
However keep in mind, you may’t construct a 3rd ground in the event you don’t have a second ground but.
In different phrases, there can by no means be an <h3>
ingredient in your web page until you’ve first declared <h2>
.
A few of the HTML parts that you just used above include textual content solely.
Others include extra HTML parts that construction the content material additional:
Line | HTML Component | Description |
---|---|---|
17 | <em> |
Emphasizes content material |
18 | <robust> |
Signifies essential content material |
21 | <li> |
Listing merchandise, have to be contained in a listing ingredient |
All HTML tags convey which means.
Due to this fact, it’s vitally essential to rigorously select which markup you employ for parts of your content material.
While you use the fitting semantics, you then allow everyone to eat your content material the way in which that you just meant.
You make your web site accessible for all:
The Internet is basically designed to work for all individuals, no matter their {hardware}, software program, language, location, or capability. When the Internet meets this purpose, it’s accessible to individuals with a various vary of listening to, motion, sight, and cognitive capability. (Source)
Some HTML parts are fairly simple.
For paragraphs, you employ <p>
.
Different parts are a bit more durable to know:
Kushagra Gour supplies an awesome abstract in his weblog entry Strong vs Em:
If it’s simply visible significance, you need
robust
. If it alters the sentence which means, useem
.
In different phrases, em
means that you’d emphasize the phrase whereas talking. For instance, if somebody mentioned, “You don’t look unhealthy,” you would possibly marvel, “However do I scent unhealthy?” The position of emphasis is vital to the which means of the sentence.
For those who merely need to draw the reader’s consideration to a bit of vocabulary, for instance, you then’d most likely need to use robust
as a substitute.
When unsure, don’t hesitate to seek for HTML names on the Internet.
You’ll discover discussions and utilization notes about any HTML ingredient.
Moreover, your browser’s default styling of HTML can provide a good impression by styling parts in another way:

With markup, you add which means to your web site’s content material.
Writing semantically right HTML is essential for understanding your content material.
Utilizing correct semantics in your HTML doc isn’t simply useful for the browser. It additionally makes the rendered HTML web page accessible for customers who eat your content material with text-to-speech software program.
If you wish to be taught extra about fashionable HTML, then HTML5 Doctor is a superb useful resource.
To be taught extra about accessibility, you may try Google’s course on making the Internet accessible to all.
Hyperlinks, Photos, and Tables
Leaping from one web site to a different is an important a part of the Web.
These references are referred to as hyperlinks, generally known as hyperlinks.
With out hyperlinks, web sites would exist in a silo, and you might solely entry them in the event you knew the online tackle.
Additionally, you wouldn’t be capable to navigate amongst a number of pages of a web site in the event you didn’t have hyperlinks that linked the pages.
To attach the HTML paperwork that you just’ve created up to now, add a navigation menu to your HTML supply code:
<!-- index.html-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Am I HTML already?</title>
</head>
<physique>
<nav>
<a href="emoji.html">Emoji</a>
</nav>
<!-- ... -->
</physique>
</html>
With the <nav>
ingredient, you declare a bit that gives navigation.
Within <nav>
, you add a hyperlink with an <a>
tag, which is brief for anchor.
The href
attribute stands for Hypertext Reference, containing the hyperlink’s goal.
With relative hyperlinks, you may reference information in your directory tree.
You could anticipate to see a URL at any time when you might have a hyperlink, however that’s not the case with relative hyperlinks.
On this case, you hyperlink to a file named emoji.html
.
The browser understands that it may well discover emoji.html
in the identical listing and completes the complete URL for you.
That approach, you don’t want to fret about altering any absolute paths once you resolve to deploy your web project sooner or later.
Up to now, emoji.html
doesn’t exist.
To repair this, create a brand new file named emoji.html
subsequent to index.html
:
<!-- emoji.html-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My favourite emoji</title>
</head>
<physique>
<nav>
<a href="index.html">House</a>
</nav>
<h1>My favourite emoji</h1>
<p>I do not simply <em>like</em> emoji,<br>
I <robust>love</robust> emoji!</p>
<p>This is a listing of my most-used emoji:</p>
<ol>
<li>🐞</li>
<li>🐍</li>
<li>👍</li>
</ol>
</physique>
</html>
The construction of emoji.html
is just like index.html
.
The content material of <physique>
in emoji.html
is sort of an identical to the random information part of index.html
, besides that you just modified the headline and moved it up one stage to be <h1>
.
On the high of <physique>
, you even have a <nav>
ingredient.
This time, nevertheless, you’re linking to index.html
.
Subsequent, create a brand new folder named photos/
inside your undertaking listing and add a file named gallery.html
:
1<!-- photos/gallery.html -->
2
3<!DOCTYPE html>
4<html lang="en">
5<head>
6 <meta charset="utf-8">
7 <title>Picture gallery</title>
8</head>
9<physique>
10<nav>
11 <a href="../index.html">House</a>
12 <a href="../emoji.html">Emoji</a>
13</nav>
14<h1>Picture gallery</h1>
15</physique>
16</html>
You’ll add some photos to gallery.html
in a second.
However first, take a look at traces 11 and 12, the place you hyperlink to your different pages.
As a result of index.html
and emoji.html
are one folder above gallery.html
, you need to prefix the hyperlink goal with two dots (..
) and a slash (/
).
For extra handy entry, you may as well add a hyperlink to your gallery within the navigation menu of index.html
:
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Am I HTML already?</title>
</head>
<physique>
<nav>
<a href="emoji.html">Emoji</a>
<a href="photos/gallery.html">Gallery</a>
</nav>
<!-- ... -->
You too can hyperlink to your gallery in emoji.html
:
<!-- emoji.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My favourite emoji</title>
</head>
<physique>
<nav>
<a href="index.html">House</a>
<a href="photos/gallery.html">Gallery</a>
</nav>
<!-- ... -->
For those who add a hyperlink to an HTML web page, you then all the time have to consider navigating there from the file that you just’re in proper now.
The gallery.html
file is one listing beneath index.html
in a folder named photos/
.
So once you’re linking to gallery.html
, then it’s essential to embody the subfolder within the hyperlink, which you’ve executed above.
Relative hyperlinks are helpful for linking pages of your web site.
While you need to add exterior hyperlinks, you then use absolute hyperlinks:
<!-- index.html -->
<!-- ... --->
<h2>Hyperlinks</h2>
<p>My favourite web sites are:</p>
<ul>
<li><a href="https://www.realpython.com">realpython.com</a></li>
<li><a href="https://www.python.org">python.org</a></li>
<li><a href="https://www.pypi.org">pypi.org</a></li>
</ul>
<!-- ... --->
As a substitute of linking to HTML information, you’re linking to absolute internet addresses in your checklist of favourite web sites.
These hyperlinks are the identical ones that you just’d kind into your browser’s tackle bar.
Hop to the browser and navigate round your web site with the hyperlinks that you just simply added:
Hyperlinks aren’t simply helpful for connecting the pages of your web site—they’re a significant a part of the Web’s infrastructure.
If you wish to be taught extra about hyperlinks, then try this HTML anchors tutorial.
One other important ingredient of the Internet is photos.
With out the power to share trip photos and cat GIFs, the Web can be uninteresting.
You connect photos to your HTML doc with an <img>
ingredient that comprises an src
attribute.
Identical to with href
in a hyperlink, you reference the picture supply in src
.
Moreover, it is best to all the time use the alt
attribute so as to add various textual content that describes the picture.
That approach, you make your web site accessible to individuals utilizing display readers.
Replace gallery.html
and hyperlink to a few photos:
<!-- photos/gallery.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Picture Gallery</title>
</head>
<physique>
<nav>
<a href="../index.html">House</a>
<a href="../emoji.html">Emoji</a>
</nav>
<h1>Picture Gallery</h1>
<img src="sky_1.png" alt="Cloudy sky.">
<img src="sky_2.png" alt="Solar shining by means of a cloudy sky.">
<img src="sky_3.png" alt="Sky with nearly no clouds.">
</physique>
</html>
You’ll discover the sky photos inside the photos/
folder after downloading the supplies by clicking the code beneath:
For those who use your individual photos, then it’s essential to modify the filenames accordingly.
Don’t overlook to additionally replace the alt
textual content to explain the content material of the photographs to make your images accessible.
The alt
textual content is broadly similar to docstrings in Python.
Whereas a docstring might describe the aim of an object, the alt
textual content describes the content material of a picture.
Identical to a docstring, an alt
textual content ought to finish with a dot (.
).
Including extra info to your photos is further work, but it surely’s value doing.
If there’s a cute canine in an image, everyone deserves to know that there’s a cute canine within the image.
In case you want any convincing, head over to Alt-texts: The Ultimate Guide on axess lab.
While you open gallery.html
within the browser, your web page ought to look just like this:

Photos are a good way to make your web site extra visually interesting.
Nevertheless, the picture gallery is a bit far and wide, and with none extra styling, the web site appears slightly old-school.
It’s time to vary that!
Within the subsequent part, you’ll add styling guidelines to your HTML and acquire higher management over how the weather in your web site look.
Type Your Content material With CSS
While you open a plain HTML file within the browser, the browser provides some styling by default.
That’s why you had been in a position to differentiate the weather within the earlier part though you didn’t add any styling your self.
That’s mainly a service from the browser to you as a human.
However strictly talking, once you write HTML, you solely outline the markup of your web site.
Pure HTML doesn’t present any styling for the weather in your web page.
To model parts, it’s essential to add CSS.
CSS stands for Cascading Type Sheets.
As you’ll see later, you may mix and nest your CSS styling guidelines,
therefore the identify cascading model sheets.
Identical to HTML, it’s a cornerstone expertise of the Web.
It lets you separate the look of your web site from the precise content material:
Along with having good semantics and a pretty format, your content material ought to make logical sense in its supply order — you may all the time place it the place you need utilizing CSS afterward, however it is best to get the supply order proper to start out with, so what display reader customers get learn out to them will make sense. (Source)
On this part, you’ll learn to take management of your web site’s styling by including CSS.
Add Shade to Your Web site
Up to now, you’ve solely used the browser to load your HTML file.
However internet browsers are highly effective instruments, and so they may also help you tremendously once you develop a web site.
You’ll be able to examine any web site with the developer tool pane of your browser.
Particularly once you work with CSS, your browser’s developer instruments turn out to be useful:
Observe that the modifications in your developer instruments don’t persist.
While you reload your web page, all modifications are gone.
So when you’re joyful together with your model changes, it’s essential to copy and paste the code right into a <model>
tag in your HTML file.
Open index.html
and add the <model>
ingredient inside <head>
:
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Am I HTML already?</title>
<model>
physique
background-color: rgb(20, 40, 60);
colour: rgb(240, 248, 255);
a
colour: rgb(255, 111, 111);
</model>
</head>
<physique>
<!-- ... -->
</physique>
</html>
With the <model>
ingredient, you may add CSS code to your HTML doc.
Though browsers aren’t strict about it, it is best to place the <model>
ingredient inside <head>
solely.
In any other case, the browser would possibly attempt to render parts earlier than making use of any CSS guidelines, which might trigger a flash of unstyled content.
The content material of <model>
isn’t HTML code, however CSS.
With CSS, you outline guidelines on the way to model parts on the web page.
With selectors, you outline which parts you need to goal, adopted by a declaration block.
Within the CSS code above, you’re utilizing type selectors to focus on <physique>
and all <a>
parts.
You’ll use another sorts of CSS selectors later within the tutorial.
If you wish to be taught extra about CSS selectors already, then head over to Mozilla’s CSS selectors web page.
The declaration block is delimited by a gap brace () and a closing brace (
).
You separate the declarations inside a block with semicolons (;
).
The declaration itself is structured in two components:
- Property: The identifier defining the function
- Worth: The outline of how the function needs to be dealt with
The property and the worth are separated by a colon (:
).
Within the instance above, you’re altering the background colour of <physique>
to a darkish blue and the textual content to a really gentle grey by specifying their RGB values.
Within the second CSS ruleset, you’re coloring all hyperlinks in a contemporary salmon hue.
Colours are an essential a part of controlling the feel and appear of your web site.
In CSS, you might have a number of methods of describing a colour.
You’ll be able to try Smashing Journal’s guide to modern CSS colors to develop your data about the usage of colours in CSS.
Observe: There are greater than a hundred different properties that you should utilize and loads of values that you could assign to them. However similar to with Python, the extra CSS you write, the extra you study its capabilities, quirks, and normal syntax.
Moreover the number of colours, you may change the face of your web site with fonts.
You already modified the colour of the textual content.
Subsequent, modify the textual content dimension of physique
with the font-size
property:
<!-- index. html -->
<!-- ... -->
<model>
physique
background-color: rgb(20, 40, 60);
colour: rgb(240, 248, 255);
font-size: 1.3em;
a
colour: rgb(255, 111, 111);
</model>
<!-- ... -->
With font-size: 1.3em;
you inform the browser to show the textual content 1.3
instances greater than the font dimension of the mum or dad ingredient.
The mum or dad ingredient of <physique>
is <html>
, so the textual content will likely be displayed 1.3
instances bigger than the default font dimension in a browser.
The default font dimension is normally sixteen pixels, so the textual content will likely be displayed at a dimension of round twenty-one pixels.
You may outline the font dimension with pixels straight.
Nevertheless, it’s widespread to make use of both percentages or em
for textual content sizes:
Named after the letter “M,” the em unit has a long-standing custom in typography the place it has been used to measure horizontal widths. (Source)
Again once you needed to cast letters into steel blocks, the letter M normally took the entire horizontal width of the solid block.
In CSS, you should utilize em
for vertical lengths too, and it’s unit for creating scalable designs.
Meaning your customers can zoom in in your web site with out breaking the design.
That is essential when customers need to improve the font dimension to higher learn your content material or once they go to your web site from a cell gadget.
Pixels and em
are solely two of many length units in CSS that you should utilize.
While you begin specializing in designing your web site, it’s value taking a look at these models and enjoying round with various kinds of models.
Moreover the scale of the textual content, the font that you just’re displaying the textual content in is one other cornerstone that impacts the design of your web site tremendously.
Change the Font
Fonts are an exceptional software for altering the character of your paperwork.
When utilizing fonts in your web site, you might have two choices:
- Depend on the fonts your customer has put in on their system.
- Load customized internet fonts from both your server or exterior sources.
With both choice, it’s a good suggestion to outline a font stack.
While you checklist a couple of font for font-family
, the browser then tries to load the fonts from left to proper:
<!-- index. html -->
<!-- ... -->
<model>
physique
background-color: rgb(20, 40, 60);
colour: rgb(240, 248, 255);
font-family: "Helvetica", "Arial", sans-serif;
font-size: 1.3em;
a
colour: rgb(255, 111, 111);
</model>
<!-- ... -->
While you declare a font stack as proven above, the browser first tries to load the Helvetica typeface.
If the browser can’t discover a font within the font stack, then it continues by making an attempt to load the following fallback font.
On this case, the browser will load any sans-serif font if neither Helvetica nor Arial is current.
Choosing the proper font to your undertaking is an effective begin to making your content material understandable.
However take into account that moreover the font, there are different components that affect the legibility of your texts.
You’ll be able to mess around with the feel and appear of your web typography by adjusting the font dimension, line top, and colours.
The extra readable your texts are, the extra accessible they’re for everybody!
Observe: You’ll be able to kind your CSS properties any approach you want. An alphabetical order might be extra maintainable in the long term, whereas grouping properties by their performance may be extra intuitive to write down.
Some CSS builders even kind their CSS properties by length.
Open index.html
in your browser and take a look at which font shows for you:

You need to use your browser’s developer instruments to investigate which font was loaded.
What if it’s not Helvetica or Arial?
Hop to the feedback beneath and let the Actual Python neighborhood know which font your system hundreds!
If you wish to have extra management over the displayed font, then it’s essential to load customized internet fonts.
How to use @font-face in CSS is a superb information on implementing customized internet fonts in your web site.
With the CSS that you just’ve added to your HTML, you’re solely scratching the floor of designing your web site.
There are nearly infinite methods of styling your content material with CSS.
If you wish to dive in deeper, then you may try Mozilla’s CSS reference.
Separate Your Issues
You added the CSS code from the earlier part straight into index.html
with the assistance of the <model>
ingredient.
For those who wished to model emoji.html
the identical approach, you then’d want to repeat and paste the code.
As a Python developer, you already know that replicate and pasting code isn’t the most effective concept.
You find yourself with the identical code in two locations, which makes updating your code cumbersome.
In your Python code, you may import modules to stop repeating your self.
HTML gives comparable performance to load exterior sources into your HTML code.
This lets you load an exterior CSS file and confer with this model sheet out of your HTML information.
Create a brand new file named model.css
subsequent to index.html
and emoji.html
.
Then, reduce the content material of <model>
from index.html
and paste it into model.css
:
1/* model.css */
2
3physique
4 background-color: rgb(20, 40, 60);
5 colour: rgb(240, 248, 255);
6 font-family: "Helvetica", "Arial", sans-serif;
7 font-size: 1.3em;
8
9
10a
11 colour: rgb(255, 111, 111);
12
Observe that your CSS file comprises solely the CSS declarations.
In a CSS file, you don’t want the <model>
tag that you just used to wrap your CSS code in index.html
.
Additionally, spot the syntax of CSS feedback in line 1.
A ahead slash adopted by an asterisk (/*
) signifies the beginning of a remark.
You’ll be able to distribute a CSS comment over a number of traces.
You shut the remark with one other asterisk adopted by a ahead slash (*/
).
Now you may reference model.css
within the head of your index.html
file:
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Am I HTML already?</title>
<hyperlink rel="stylesheet" href="model.css">
<!-- Eliminated: <model> ... </model> -->
</head>
<!-- ... -->
The <hyperlink>
ingredient is just like the anchor tag (<a>
).
It additionally comprises an href
attribute that defines the hyperlink.
Nevertheless, it’s an empty ingredient that comprises attributes solely and gained’t render a clickable hyperlink.
Add the stylesheet
hyperlink to emoji.html
as properly:
<!-- emoji.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My favourite emoji</title>
<hyperlink rel="stylesheet" href="model.css">
</head>
<!-- ... -->
To mirror the modifications in gallery.html
too, add the relative hyperlink to model.css
:
1<!-- gallery.html -->
2
3<!DOCTYPE html>
4<html lang="en">
5<head>
6 <meta charset="utf-8">
7 <title>Picture Gallery</title>
8 <hyperlink rel="stylesheet" href="../model.css">
9</head>
10
11<!-- ... -->
Do not forget that model.css
is one listing above gallery.html
, which is in your photos/
listing.
So as a substitute of simply linking to model.css
, you need to hyperlink to ../model.css
.
When you’ve up to date the CSS references, take a look at your pages within the browser:
All of your pages share the identical styling now.
While you change the CSS code in model.css
, you may see the modifications showing on all pages.
As a Python internet developer, you’ll most likely want to write down little bit of HTML your self in internet tasks.
For CSS, nevertheless, it’s pretty widespread to make use of exterior CSS frameworks to handle your design.
A CSS framework supplies you with ready-made CSS code.
To be able to use a CSS framework to its full benefit, you could want to regulate your HTML code to adjust to its ruleset.
However when you’ve gotten used to a CSS framework, it may well prevent the work of explicitly styling HTML parts in the long term.
Some of the common CSS frameworks is Bootstrap.
You’ll additionally encounter Simple.css or Bulma, together with in Actual Python tutorials on managing your to-do lists and creating a flashcards app.
Observe: If you wish to begin your CSS designs from scratch, you may as well load an exterior reset model sheet. By including a reset style sheet earlier than loading your types, you reset all the browser’s default types. This offers you full management over styling any HTML ingredient in your web page.
You’ll be able to add exterior, non-local CSS model sheets similar to your native model sheet with the <hyperlink>
ingredient.
For those who reference a couple of model sheet in your web site, the order issues.
You’ll examine this conduct in a second.
First, go forward and add one other model sheet hyperlink to your HTML pages.
Right here’s the instance code for index.html
:
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Am I HTML already?</title>
<hyperlink rel="stylesheet" href="https://cdn.simplecss.org/easy.css">
<hyperlink rel="stylesheet" href="model.css">
</head>
<!-- ... -->
Because the C in CSS implies, you may as well cascade model sheets.
While you open index.html
in your browser, you may see that the design has modified:

You mixed the model guidelines of your native model.css
and the exterior easy.css
.
Mess around with the order of the way you load the exterior model sheets.
While you reload your pages, you’ll spot that the looks of your web site modifications.
Much like overwriting variables in Python, CSS properties overwrite one another.
Typically talking, the final worth that’s utilized to a component wins.
On this part, you discovered that you should utilize an exterior model sheet as a substitute of the <model>
ingredient.
There’s even a 3rd approach so as to add CSS guidelines to your HTML.
You need to use a model
HTML attribute to model HTML parts straight. That is referred to as inline CSS styling.
Being extra specific in connecting your CSS declarations with particular HTML parts can provide the management that it’s essential to good your design.
Within the subsequent part, you’ll learn to model parts extra flexibly with CSS courses.
Use Lessons for Larger Flexibility
The CSS guidelines that you just’ve set up to now have solely focused generic HTML parts.
However you might be far more particular together with your CSS code once you set guidelines for HTML attributes.
Including a class
attribute to an HTML ingredient lets you use CSS class selectors to model parts primarily based on their class values.
An important attribute of CSS courses is that they can help you group widespread parts and apply a algorithm to all of them in a single go, after which probably replace them whereas retaining the model constant.
For instance, you may outline a category that applies rounded nook to photographs. However as a substitute of concentrating on all picture parts by utilizing the img
identify, you may assign a category to solely these photos that ought to have rounded corners.
This offers you the extra benefit of with the ability to add rounded corners to different parts by giving them the identical class.
To find out how CSS class selectors work, modify the code in gallery.html
so it appears like this:
1<!-- photos/gallery.html -->
2
3<!-- ... -->
4<head>
5 <meta charset="utf-8">
6 <title>Picture Gallery</title>
7 <hyperlink rel="stylesheet" href="https://cdn.simplecss.org/easy.css">
8 <hyperlink rel="stylesheet" href="../model.css">
9</head>
10
11<!-- ... -->
12
13<h1>Picture Gallery</h1>
14<div class="gallery rounded">
15 <img src="sky_1.png" alt="Cloudy sky." class="rounded">
16 <img src="sky_2.png" alt="Solar shining by means of a cloudy sky." class="rounded">
17 <img src="sky_3.png" alt="Sky with nearly no clouds." class="rounded">
18</div>
19<!-- ... -->
First, keep in mind so as to add a hyperlink to your exterior model sheets.
Don’t overlook to prepend the 2 dots to hyperlink to ../model.css
as a result of the model sheet is one folder above gallery.html
.
Then, you’re wrapping the <img>
parts in a <div>
block.
The <div>
ingredient is a generic ingredient for structuring your web page.
It doesn’t include any semantic which means, and it is best to solely use it when no different HTML tag is extra acceptable to make use of.
You additionally add class
attributes to your HTML parts.
In line 14, you’re even chaining courses in a space-separated checklist.
Because of this you apply two CSS courses to the <div>
ingredient.
In distinction, the <img>
parts in traces 15 to 17 solely include one CSS class.
To create the courses, head over to model.css
and add this CSS code:
1/* model.css */
2
3/* ... */
4
5.gallery
6 background: rgba(255, 255, 255, 0.2);
7 padding: 1em;
8
9
10.rounded
11 border-radius: 15px;
12
13
14.gallery img
15 margin-right: 0.2em;
16 width: 150px;
17
You confer with CSS courses within the HTML class
attribute and not using a dot (.
).
In your CSS code, nevertheless, you need to add a dot originally of a selector to specify that you just’re concentrating on the class
attributes.
If you wish to learn extra about CSS selectors, then head over to Mozilla’s CSS selectors documentation.
In traces 6 and seven, you set the foundations for .gallery
, like a partly clear background and a 1em
padding so as to add area to all sides inside the gallery ingredient.
With the .rounded
selector, you give all HTML parts that include this class a rounded nook with a radius of fifteen pixels.
You’ll be able to even chain your CSS selectors as you do in line 14.
With the space-separated selector checklist .gallery img
, you’re including a rule for all img
parts inside an HTML ingredient with the category gallery
.
Along with your CSS declarations in traces 15 and 16, you give them some area to the fitting aspect with margin-right
and make the gallery photos 150 pixels huge.
With padding
, margin
, and border
properties, you outline the spacing of CSS parts.
You’ll be able to consider these parts as containers which have a sure area round them and area inside them the place the content material is saved.
This idea is named the field mannequin:
All the things in CSS has a field round it, and understanding these containers is vital to with the ability to create extra complicated layouts with CSS, or to align objects with different objects. (Source)
If you wish to dive deeper into CSS, then studying concerning the field mannequin is vital.
You’ll be able to comply with Mozilla’s learn to style HTML using CSS tutorial to get a greater understanding of all of the constructing blocks that CSS comprises.
You’ll be able to take off from right here and discover the world of markup and design that HTML and CSS supply.
However particularly with HTML, you’ll quickly discover that it’s a really verbose language, and it may be cumbersome to write down it by hand.
That’s the place you may let your abilities as a Python developer shine.
Within the subsequent part, you’ll find out how Python may also help you to work with HTML information extra successfully.
Deal with HTML With Python
As a Python developer, you already know that Python generally is a useful gizmo to automate duties that you just’d in any other case have to do by hand.
Particularly when working with massive HTML information, the ability of Python can prevent some work.
Programmatically Write HTML
With all of the opening and shutting tags, HTML might be cumbersome to write down.
Fortunately, Python is ideal that can assist you programmatically create massive HTML information.
On this part, you’ll lengthen emoji.html
to show extra details about your favourite emoji.
Change the ordered checklist with a desk:
1<!-- emoji.html -->
2
3<!-- ... -->
4<h1>My favourite emoji</h1>
5<p>I do not simply <em>like</em> emoji,<br>
6I <robust>love</robust> emoji!</p>
7<p>This is a desk of my most-used emoji:</p>
8
9<desk>
10 <thead>
11 <tr>
12 <th>#</th>
13 <th>Emoji</th>
14 <th>Identify</th>
15 </tr>
16 </thead>
17 <tbody>
18 <tr>
19 <td>1.</td>
20 <td>🐞</td>
21 <td>Girl Beetle</td>
22 </tr>
23 <tr>
24 <td>2.</td>
25 <td>🐍</td>
26 <td>Snake</td>
27 </tr>
28 <tr>
29 <td>3.</td>
30 <td>👍</td>
31 <td>Thumbs Up Signal</td>
32 </tr>
33 </tbody>
34</desk>
35<!-- ... -->
You outline an HTML desk with the <desk>
ingredient and desk rows with <tr>
.
Identical to a desk in a spreadsheet, HTML tables can have a desk head and a desk physique.
Whereas utilizing <thead>
and <tbody>
isn’t compulsory for a desk to work, it’s good observe so as to add them to your desk markup.
In your desk head, you outline three desk columns by including three <th>
parts to the primary row.
The desk physique comprises the identical variety of columns and a number of rows.
For the desk knowledge cells, you employ the identical <td>
ingredient as you do within the desk header.
The emoji desk lists your three favourite emoji with their Unicode descriptions.
After all, no person has solely three favourite emoji!
Even with a average quantity like twelve favourite emoji, it’d be annoying to create the HTML desk by hand.
So that you add Python into the combination!
Create a brand new Python file named emoji_table.py
in your undertaking listing, and let Python do the be just right for you:
# emoji_table.py
import unicodedata
all_emoji = "🐞🐍👍🎉🤩😂🐶🍿😎✨💬😘"
columns = ["#", "Emoji", "Name"]
table_head = f"<thead>n<tr><th>'</th><th>'.be part of(columns)</th></tr>n</thead>"
table_body = "n<tbody>n"
for i, emoji in enumerate(all_emoji, begin=1):
emoji_data = [f"i.", emoji, unicodedata.name(emoji).title()]
table_body += f"<tr><td>'</td><td>'.be part of(emoji_data)</td></tr>n"
table_body += "</tbody>n"
print(f"<desk>ntable_headtable_body</desk>")
With the assistance of the built-in unicodedata
module and enumerate()
, Python can programmatically construct an emoji desk for you.
Observe: The newline symbols (n
) within the strings are non-obligatory. The browser will ignore any whitespace that’s a couple of area. However utilizing n
will make your HTML code a bit prettier.
Run emoji_table.py
in your terminal, copy the HTML code, and paste it into emoji.html
:
1<!-- emoji.html -->
2
3<!-- ... -->
4<h1>My favourite emoji</h1>
5<p>I do not simply <em>like</em> emoji,<br>
6I <robust>love</robust> emoji!</p>
7<p>This is a desk of my most-used emoji:</p>
8
9<desk>
10<thead>
11<tr><th>#</th><th>Emoji</th><th>Identify</th></tr>
12</thead>
13<tbody>
14<tr><td>1.</td><td>🐞</td><td>Girl Beetle</td></tr>
15<tr><td>2.</td><td>🐍</td><td>Snake</td></tr>
16<tr><td>3.</td><td>👍</td><td>Thumbs Up Signal</td></tr>
17<tr><td>4.</td><td>🎉</td><td>Get together Popper</td></tr>
18<tr><td>5.</td><td>🤩</td><td>Grinning Face With Star Eyes</td></tr>
19<tr><td>6.</td><td>😂</td><td>Face With Tears Of Pleasure</td></tr>
20<tr><td>7.</td><td>🐶</td><td>Canine Face</td></tr>
21<tr><td>8.</td><td>🍿</td><td>Popcorn</td></tr>
22<tr><td>9.</td><td>😎</td><td>Smiling Face With Sun shades</td></tr>
23<tr><td>10.</td><td>✨</td><td>Sparkles</td></tr>
24<tr><td>11.</td><td>💬</td><td>Speech Balloon</td></tr>
25<tr><td>12.</td><td>😘</td><td>Face Throwing A Kiss</td></tr>
26</tbody>
27</desk>
28<!-- ... -->
With emoji_table.py
, now you can develop your HTML emoji desk to incorporate all of your favourite emoji.
If you wish to make your desk look a bit higher, then you may add extra styling with the :nth-child()
pseudo-class in model.css
:
/* model.css */
/* ... */
th, tr:nth-child(even)
background-color: rgba(255, 255, 255, 0.2);
td:nth-child(1)
text-align: proper;
td:nth-child(2)
text-align: middle;
HTML tables are a good way to construction tabular knowledge in your web site.
You’ll be able to try Mozilla’s documentation about HTML tables and styling tables to be taught extra about working with tables in HTML.
Though emoji_table.py
helps you construct bigger tables, it’s nonetheless an advanced course of.
At present, it’s essential to copy the terminal output into your HTML file.
That’s not supreme.
However now it’s time to discover different ways in which Python may also help you together with your HTML code.
Create HTML Entities With Python
HTML comes with a giant checklist of named character references that you should utilize to encode your texts in HTML.
So, for instance, you might write the euro foreign money signal because the HTML entity €
as a substitute of the UTF-8 €
character.
Up to now, encoding characters like this was essential as a result of there was no approach to kind them straight.
With the arrival of UTF-8 character encoding, you should utilize the precise UTF-8 character as a substitute.
More often than not, that’s even really useful as a result of it’s extra readable.
Nonetheless, there are conditions the place HTML encodings are the higher alternative.
As a rule of thumb, you employ HTML entities when characters:
- Are visually not distinguishable
- Intervene with HTML syntax
Take whitespace characters, for instance.
There are twenty-five whitespace characters listed within the Unicode character database.
A few of them look precisely the identical, just like the common area (
) and the non-breaking space (
).
Visually, the areas aren’t distinguishable.
However once you take a look on the supply code of this web page, you’ll see that the latter is escaped as its HTML entity,
:

If you wish to show HTML tags on an HTML doc, you additionally want to flee characters just like the opening angle bracket (<
) and the closing angle bracket (>
).
Once more, take a look on the supply code of this tutorial and notice how the angle brackets are escaped:

The opening angle brackets are escaped as <
.
Closing angle brackets are escaped as >
.
To see a full checklist of HTML entities, you may leverage Python’s built-in html
module:
>>> import html
>>> html.entities.html5
'Aacute': 'Á', 'aacute': 'á', 'Aacute;': 'Á', 'aacute;': 'á',
...
'zscr;': '𝓏', 'zwj;': 'u200d', 'zwnj;': 'u200c'
The entities
module of html
defines 4 dictionaries.
Considered one of them is html5
, which maps the HTML-named character references to their Unicode character counterparts.
With html.entities.codepoint2name
you’ll find the HTML entity identify of a personality:
>>> import html
>>> code_point = ord("€")
>>> code_point
8364
>>> html.entities.codepoint2name[cp]
'euro'
The codepoint of the euro (€
) is 8364
.
For 8364
the codepoint2name
dictionary returns 'euro'
.
To make use of the identify in your HTML code, you need to put an ampersand (&
) earlier than the identify and a semicolon (;
) after the identify to get the legitimate €
HTML entity.
As a substitute of remembering and writing the HTML entities your self, you may let Python aid you out.
Python’s html
module additionally comes with a parser that’s helpful once you need to dissect HTML paperwork.
Parse HTML With Python
When it’s essential to learn knowledge from HTML information, then Python can help you with the built-in html
module as properly.
On this part, you’ll construct a primitive HTML parser utilizing html.parser
.
The script you’ll write will confer with the gallery.html
file that you just created earlier on this tutorial.
You’ll be able to both revisit that part of the tutorial or obtain all of the information by clicking the hyperlink beneath:
Subsequent to gallery.html
, create a brand new Python file named parse_image_links.py
:
# photos/parse_image_links.py
from html.parser import HTMLParser
class ImageParser(HTMLParser):
def handle_starttag(self, tag, attrs):
for attr, val in attrs:
if attr == "src" and tag == "img":
print(f"Discovered Picture: val!r")
with open("gallery.html", mode="r", encoding="utf-8") as html_file:
html_content = html_file.learn()
parser = ImageParser()
parser.feed(html_content)
While you feed an occasion of Python’s HTMLParser
with HTML knowledge, the occasion calls its handler strategies if markup parts are discovered.
Within the instance above, you create a subclass of HTMLParser
to search for any <img>
parts with an src
attribute within the code of gallery.html
.
For the gallery.html
file, the output appears like this:
Discovered Picture: 'sky_1.png'
Discovered Picture: 'sky_2.png'
Discovered Picture: 'sky_3.png'
To your native file, which you’ll simply lookup in your editor, this may not be a giant deal.
However think about the probabilities in the event you adjusted the script above to learn the code from any given URL!
If Python’s html
module has sparked your curiosity, then studying a practical introduction to web scraping in Python is an effective subsequent step.
For a extra hands-on method, you may as well build a web scraper with Beautiful Soup.
Earlier than you parse away, take a look at another subsequent steps within the final part of this tutorial.
Proceed With HTML and CSS in Python
You’ll be able to accomplish fairly a bit with fundamental HTML and CSS.
Working with HTML and CSS can change into much more enjoyable once you put a programming language like Python into the combination.
On this part, you’ll get an summary of applied sciences that you could be discover to leverage your data of HTML and CSS.
JavaScript
As you discovered on this tutorial, HTML supplies the construction of a web site.
With CSS, you add formatting and format.
That’s an awesome foundation for creating web sites.
But no introduction to HTML and CSS can be full with out mentioning JavaScript.
JavaScript is an interpreted programming language that’s essential for contemporary web sites.
With JavaScript, you may add performance to your internet tasks.
For instance, you may dynamically replace HTML and CSS when a consumer interacts together with your web site.
Studying JavaScript is an effective alternative for any programmer who needs to get into internet improvement.
To dive deeper into JavaScript, head over to Mozilla’s learning area for JavaScript.
If you wish to discover JavaScript from a Python programmer’s perspective, then try Python vs JavaScript for Pythonistas.
Jinja
On this tutorial, you saved HTML markup in Python strings to create HTML code dynamically.
When your internet undertaking evolves, then the combination of HTML and Python can develop difficult.
To separate issues, it’s a good suggestion to work with templates.
With templates, you may create constructing blocks for bigger web sites with out duplicating your front-end code.
That approach, you may preserve your HTML markup in template information and fill them with Python.
The go-to template engine for Python is Jinja.
With Python and Jinja, you may dynamically create HTML code.
However you don’t should cease there.
Anytime you need to create textual content information with programmatic content material, Jinja may also help you out.
If you wish to learn to construct wealthy templates with Jinja, then try Actual Python’s primer on Jinja templating.
Flask
With fundamental data about HTML and CSS, you’re properly outfitted to construct your first actual internet purposes.
HTML and CSS handle the entrance finish that the consumer is interacting with.
To load the content material from the server, you want some sort of again finish.
That’s the place internet frameworks come into play.
Flask is a well-liked Python internet framework that’s nice for constructing internet purposes from scratch.
After you put in the flask
package deal with pip
, you then begin a Flask undertaking by making a Python file with only a few traces of code.
In different phrases, you begin small and improve your undertaking step-by-step at your individual tempo.
You’ll be able to comply with the Flask by Example studying path to find the fundamentals of Python internet improvement with the Flask microframework.
Django
Django is one other common Python internet framework.
In comparison with Flask, Django supplies you with a undertaking construction once you begin a brand new Django undertaking.
With out including a lot code your self, you may work with an admin back end and databases straight away.
The ability of Django can provide you a head begin for greater internet tasks, however navigating all of the information might be overwhelming for rookies.
Fortunately, you’ll find loads of Django tutorials on Real Python to information you.
You will get began with Django by building a portfolio app or by building a personal diary web app.
If you wish to construct an even bigger undertaking, then the Django social network series is ideal for you.
PyScript
PyScript is a brand new framework that lets you run Python within the internet browser.
However don’t confuse it with internet frameworks like Flask or Django:
PyScript is simply HTML, solely a bit (okay, perhaps rather a lot) extra highly effective, because of the wealthy and accessible ecosystem of Python libraries. (Source)
For those who’re intrigued, then give A First Look at PyScript: Python in the Web Browser a learn.
Conclusion
Irrespective of which path to changing into a Python internet developer you select, there’s no approach round HTML and CSS.
Each applied sciences are elementary constructing blocks once you need to create web sites.
All through this tutorial, you constructed a boilerplate HTML doc to present you a head-start in your upcoming internet tasks.
Alongside the way in which, you discovered the way to:
- Construction a fundamental HTML file
- Present photos and hyperlink to pages
- Type a web site with CSS
- Format HTML with accessibility in thoughts
- Use Python to write and parse HTML code
Python, HTML, and CSS are a strong trio that lets you create small HTML paperwork and massive internet tasks.
However even in the event you’re not aiming for a profession as an internet developer, figuring out a factor or two about HTML and CSS will aid you perceive the Internet higher.