Introduction to make a website from scratch!!
HTML meaning Hypertext Mark-up Language
is a web developer tool used to create the building blocks of a website.
HTML, unlike other programming languages, does not involve any
form of logic but simply renders text to be viewed by a browser, that is
why it is referred to as a mark-up language.
HTML is written with what is referred to as elements on code
editors and the output is viewed in browsers. These elements consist
of opening and closing tags (or could be a self enclosing tag depending on the
type), and the tags may contain attributes and attribute values.
<button> and </button> are the opening and closing tags
id is the attribute
"button" is the attribute value
CSS means cascading Style Sheet. It is use to add designs
to our HTML codes, giving our website its outlook. There are used to
give HTML visual outlook that the user can relate with for proper
navigation of the site. CSS codes for a page can be written in a separate
file and named with “.css”, then linked with the HTML page in the head tag of
the HTML page using the code <link rel=”stylesheet” href=”cssFileName.css”>.
Or written on the same HTML page in an element <style></style>.
To write CSS codes, the element name is called in the CSS file or in the
inline element <style>. also, id or class can be added to some elements
to call specifics. Priority is placed on class over element style and id over
class and element style. Only HTML style added to an element overwrites these
CSS codes.
Id is called with #idName and class is called with .className.
Other tools used in web development is the java script
(JS). JS is used to add functionalities to the
website. Altogether, these tools are used by
front-end developers to create a web page.
We would be coding briefly HTLM and CSS to create a
web page such as a student login portal. The semantic of a page like this are
usually not complex and requires only basic elements.
To begin, you need
to create a header, main and footer elements in the body of the
boilerplate. To establish the boilerplate in HTML5, you use the shortcut
“! then tab” (this is after you have created a file
named with “.html” in a folder created on the code editor). The
header would contain the page logo and a navigation tab. The logo can be created
with an anchor tag to serve as a link to reload the home page and an image
nested in it
The <nav> tag could be created to nest anchor tags for the desired
pages such as; contact, about the author or institution, achievements and the
likes. The header is then styled with CSS using codes as this
Next, in the
<main>, a <form> tag is created. In the <form>,
an <heading> tag is used to create the page topic which would
be; student portal, login details etc. <input> tags are then
used to create the text area for the user which are name, email, and password.
A <button> is used to create the submit action. And attribute that says
required is added to the inputs to ensure users fill in all the details before
they can submit.
<input> and <button> are inline elements, that is, they are created on a straight line when viewed on the browser. Therefore, to make them block, they can be nested in a block element such as a <div>. <div> is a block element which help to give semantic meaning to our page
In another <div> outside the
form in the main, anchor tag, <a>, could be used to create a link
for people who have forgotten their password and for those who are yet to
register for the page.
In the footer, a region for message could be written for users to note using the paragraph tag, <p>. Also, a copyright sign could be added to the page using the code;
To style the form, it is given a
border and border-radius (to curve the edges of the border). Also, you declare
a display flex to justify the content center. Padding and margin are added to
give shape to the border. Id is assigned to the input elements of name, email,
and password and also the button and they are styled with padding and margin of
their own. Padding and margin usually measure in pixels (px), em and percentage
(%).
A design called hover in CSS can be added to our word. Hover is used to style links such that when the cursor points at the click, its outlook changes e.g. color change, size change etc. To make and hover, you write the element name or call the id or class :hover, then add the desired style
Multiple element, class and id can be called together is they have the
same styling.
This is to make our code DRY,
that is, don't repeat yourself.
Now you
can create a non-ambiguous website that is user interactive and the results can
be sent to call information from a server which is handled and coded for by
back-end developers.
- David Ojo
- Mar, 27 2022