Skip to main content

Beginner's Guide to Web Design

The fundamentals of web design



Every day, we use the internet. We use Google to look up anything we need to know. We normally receive this information from numerous websites that end in with .com, .net, .org, and so on. This is known to as a domain name. We normally type the domain name (a request), and then the request is sent to the webserver. The web server looks up the domain's IP address and then looks for its contents. The response is then sent as HTML webpages to our computer or smartphone. The readers who are currently reading this article must be interested in learning about HTML. Be patient; we're here to talk about it first. HTML is a scripting language used to create websites. It creates separate portions of the website using various tags such as <head>, <body>, <footer>, <div>, and so on. Those tags aren't displayed when we're browsing a website. They create the website's skeleton or framework, which determines how the page will appear on screen. CSS, JavaScript, PHP, and MySQL are examples of other scripting languages. Client side scripting languages, such as HTML, CSS, and JavaScript, are scripting languages that may be executed directly by browsers. However, because PHP and MySQL are server-side scripting languages, we'll need a server to run them.
You may have observed that we refer to HTML, CSS, JavaScript, and other programming languages as "scripting languages." The term 'programming language' refers to a different type of language.


The following are the differences between 'Scripting' and 'Programming' languages:


Scripting languages are used to design webpages, whereas programming languages are used for web development, application development, and game creation, and other things. C, Java, Python, etc.  are well-known examples of programming languages.
Deep Dive
We require a compiler to execute a programming language, but we simply need an interpreter to run a scripting language in a browser. During the compilation process, the interpreter reads the entire program line by line. If there is a mistake in any line, the word 'error' will appear for whole program.
In the case of scripting languages, however, the interpreter only reads HTML code on a first-come-first-served basis. It usually loads the 'head' element first, then the 'body,' and finally the contents inside the 'body.' If there is an error in the scripting language's script, only those elements are displayed on the screen that are correct. Unlike the script of a programming language, this has no affect on the entire script.


P 4

Learn HTML & CSS


 The author's main goal in this tutorial is to teach HTML and CSS in a limited number of tutorials. You can use these codes in your HTML editor, such as Notepad++, Sublime, and others. We'll use numbers to represent codes in this case. We'll go over how to write code to execute in an editor for various purposes. One of the advantages is that you will quickly learn to code in HTML and CSS.


<html>

<head>

<title> My first webpage </title>

</head>

<body>

<p> Body part will appear here </p>

</body>

</html>


A basic HTML webpage is shown in the code above. Tags include items like <head>, <body>, etc. This is how a webpage's skeleton is built. We'll go through a lot of different tags and how they work. 

Instruction: Copy code and then paste into your HTML editor, then run it.


Some frequently used HTML tags

<p>: It is used for paragraph

<h1>: for major heading

<h6>: for minor heading. We use h1, h2, h3, h4, h5, h6 – all tags for heading. If we arrange this tags as per their font size that it will be h1>h2>h3>h4>h5>h6.

HTML Element: Let me give an example. Here <p> is an HTML tag but we use it to write paragraph. For example, <p> Hello World! </p>. Using this we’ll be able to write our paragraph. Now, <p> is called HTML tag and <p> Hello World! </p> is called HTML element.

<title>: To represent title of a webpage that is shown at the top of a browser, like, welcome, home, etc.

<div>: It is used for ‘division’. In HTML webpages we frequently need it to divide webpage in several divisions. One important thing is that we can apply different types of colours, styles, fonts, etc. to different divisions. For example, we keep background color of ‘division A’ is red & for ‘division B’ we keep it blue.

<id>: ‘id’ means identity. Here is HTML webpage we assign id to a particular HTML element so that we can find it easily or we can show it in a webpage very easily. Remember that id of an element will be unique.

 

Example:


<html>

<body>

<p> I am learning to code in HTML </p>

<h1> HTML & CSS </h1>

<h2> HTML & CSS </h2>

<h3> HTML & CSS </h3>

<h4> HTML & CSS </h4>

<h5> HTML & CSS </h5>

<h6> HTML & CSS </h6>

</body>

</html>

Instruction: copy the code and paste into HTML editor. Then run it. You'll see difference of font sizes among different HTML tags.


Result:










Example of  '<div>' tag: 

<html>
<head>
<title> HTML & CSS </title>
</head>
<body>
<div style="background-color: red;">
<h1>It is division A</h1>
<p> HTML is a markup language. Here we use different types of tags. The editor can distinguish between text and tags.  </p>
</div>
<hr>
<div style="background-color: blue;">
<h1>It is division B</h1>
<p>In this page you'll learn how to code in HTML and CSS easily. Although, HTML makes skeleton of webpage, CSS presents the webpage. It adds styles, font-size, color of text, background-color of a section, etc. </p>
</div>
</body>
</html>

Result:








Here, in the above code & result we've shown how '<div>' tag works. There are two divisions, division A & division B. We can write our own topic under different divisions. At the left top corner, 'HTML & CSS' is the title of the page. It may be something like, Welcome, Contact Us, etc. '<title>' tag is used to add tittle to a webpage.


Example of '<id>' tag:

<html>

<body>

<div id="first">

<h1> This is first division of my webpage </h1>

<p> "Id" stands for identity. In school, colleges, all students should have their id card. Similarly, in  a document we can put a id to a particular section so that we can find easily later. For that id of a section or division must be unique. In case of HTML pages we use id for different HTML elements, divisions, or sections, so that we can find it easily in hundreds of words. </p>

</div>

<div id="second">

<h1> This is second division of my webpage </h2>

<p> In a division you can write your content. You can write heading or subheading first. Then, you can discuss your  topics on webpage, etc. </p>

</div>

</body>

<style>

#first {

background-color: yellow;

}

#second {

background-color: grey;

}

</style>

</html>


Result








In the above code division 1 is assigned with id "first". Then we apply color to the division calling its id. We've used '<style>' tag to add style to the 'id' (indirectly, to add style to the division because we've assigned id to the division. As, we've talk about it that id is helpful to find HTML elements, Divisions, etc. in a webpage. For, example if there is a id in a webpage named "first" and we want to show it at the top of our webpage we simply type "www.example.com#first" to our browser then element or division or section with id "first" will appear top at the webpage. 


HTML class:

For all programming languages i.e., for java, class is an important thing. In case of programming languages class is prototype, where so many objects comes under a class. and we can use each object independently. For, example we can say "car" is a class, then set of cars, like, "BMW", "Volvo", etc. will be object. Hope you have understood the concept.

In HTML we can also use classes. One popular example of Class in HTML is "footer". 


Example:

<html>
<body style="background-color: #bbb; height: 500px; width: 200px;">
<p>Body part will appear here</p>
</body>
<div class="footer">
<p>You can use different columns for footer portion. You must see "about us", "contact us", etc. such types of columns in most of the webpages</p><br><br>
<p style="align: center;"> Copyright@ Your Website 2021. All Rights reserved</p>
</div>
</html>


Here in the above code we've used class "footer". Now whatever you write on your webpage footer portion always comes at bottom line of webpage and it must be visible irrespective of your content size. Now we can add different columns under class "footer". For your knowledge if you do not use footer then the portion may not be visible at the exactly bottom of the webpage if content is large in size. Here we've talk only about class "footer" but the may be other classes like, dropdown, etc.



 CSS Tutorial

CSS stands for 'Cascading Style Sheets'. While HTML prepares skeleton of HTML webpage, CSS give us proper presentation about a webpage. Using CSS we can add font-style, font-size, text-color, background-color, background-image, etc. Let me give some simple examples of CSS below:


CSS code for changing style, font-size, color of text

<html>
<head>
<title>CSS Tutorial</title>
</head>
<body>
<div>
<p>Body part will appear here.</p>
<p>In this tutorial you'll learn how to add style, i.e., color, font-size, color, text-alignment, button-style, etc. to a webpage. For effective learning copy and paste the code in your HTML editor. And run the code and see the result.</p>
</div>
</body>
<style>
p {
font-family: sans-serif;
font-style: italic;
font-size: 15px;
color: red;
}
</style>
</html>


Result









After running the HTML code on browser you can see text color is red and it is in italic style as we have applied in CSS code here. We can also control the font size as shown in code. To add CSS style to a HTML webpage we write CSS code inside <style></style> tags. In this tutorial or in previous tutorial you must have noticed that every tags has a closing tag, like, if we write <p> tag, then we must close it by </p> tag. Similar, examples are <head></head>, <body></body>, <div></div>, etc. But there are also exceptional cases, like, <br> tag used for break the line, <hr> for drawing horizontal line in webpage.  


CSS code for changing background-color of a webpage:

Changing background-color is related to the changing background-color of 'body' portion of a webpage.  


<html>

<body>

<h1>Body part will appear here</h1>

</body>

<style>

body {

background-color: #ddd;

}

</style>

</html>


Result:












 Alignment of Text using CSS

<html>
<body>
<h1 align = "center" style=" font-size: 25px;">Title of the topic will appear here!<h1>
<p align = "justify" style = "font-size: 20px;">Content of the topic is here. Here, in this tutorial author's main aim is to teach you CSS in less number tutorials. It will be very helpful for you to learn CSS very quickly. You can build an static webpage using HTML and CSS only. But to add dynamic view to your website you must have to learn JavaScript.</p>
</body>
<html>


Result






In the result you see we've aligned the title of the topic above in the middle of the webpage by using align="center"  in <h1> tag. Similarly, if we write the code inside <p>  tag then the text written under <p> tag will be central aligned but in the above code we've chosen the alignment of <p> tag as "justify". Alternatively, we can choose "Left" or "Right" alignment as well. You should try it in your own end. You must have noticed some different style of writing CSS code instead of writing <style></style> tag. In the above we have written CSS code for <h1> and <p> tags just inside it in such a way, like, <p style= "font-size: 20px;">If you look at the first code on the page, you'll notice that there's a different way of writing CSS code for styling tag, for example,

<style>
p {
font-family: sans-serif;
font-style: italic;
font-size: 15px;
color: red;
}
</style>

Both are correct.

Learn About JavaScript (World's first Web Programming Language) >>

(Remember that JavaScript is necessary for creating a dynamic website; HTML and CSS alone are insufficient. JavaScript enables you to develop on-click events (i.e., carry out a task after hitting a button, etc.), dropdown menus, dynamic sidebars, applications, games, etc. You can manipulate a webpage's html data by utilizing HTML DOM.)

People are good at skipping over material they already know!

View Related Topics to







Contact Us

Name

Email *

Message *

Popular Posts

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...

📘 Overview of BER and SNR 🧮 Online Simulator for BER calculation of m-ary QAM and m-ary PSK 🧮 MATLAB Code for BER calculation of M-ary QAM, M-ary PSK, QPSK, BPSK, ... 📚 Further Reading 📂 View Other Topics on M-ary QAM, M-ary PSK, QPSK ... 🧮 Online Simulator for Constellation Diagram of m-ary QAM 🧮 Online Simulator for Constellation Diagram of m-ary PSK 🧮 MATLAB Code for BER calculation of ASK, FSK, and PSK 🧮 MATLAB Code for BER calculation of Alamouti Scheme 🧮 Different approaches to calculate BER vs SNR What is Bit Error Rate (BER)? The abbreviation BER stands for Bit Error Rate, which indicates how many corrupted bits are received (after the demodulation process) compared to the total number of bits sent in a communication process. BER = (number of bits received in error) / (total number of tran...

Constellation Diagrams of ASK, PSK, and FSK

📘 Overview of Energy per Bit (Eb / N0) 🧮 Online Simulator for constellation diagrams of ASK, FSK, and PSK 🧮 Theory behind Constellation Diagrams of ASK, FSK, and PSK 🧮 MATLAB Codes for Constellation Diagrams of ASK, FSK, and PSK 📚 Further Reading 📂 Other Topics on Constellation Diagrams of ASK, PSK, and FSK ... 🧮 Simulator for constellation diagrams of m-ary PSK 🧮 Simulator for constellation diagrams of m-ary QAM BASK (Binary ASK) Modulation: Transmits one of two signals: 0 or -√Eb, where Eb​ is the energy per bit. These signals represent binary 0 and 1.    BFSK (Binary FSK) Modulation: Transmits one of two signals: +√Eb​ ( On the y-axis, the phase shift of 90 degrees with respect to the x-axis, which is also termed phase offset ) or √Eb (on x-axis), where Eb​ is the energy per bit. These signals represent binary 0 and 1.  BPSK (Binary PSK) Modulation: Transmits one of two signals...

OFDM Symbols and Subcarriers Explained

This article explains how OFDM (Orthogonal Frequency Division Multiplexing) symbols and subcarriers work. It covers modulation, mapping symbols to subcarriers, subcarrier frequency spacing, IFFT synthesis, cyclic prefix, and transmission. Step 1: Modulation First, modulate the input bitstream. For example, with 16-QAM , each group of 4 bits maps to one QAM symbol. Suppose we generate a sequence of QAM symbols: s0, s1, s2, s3, s4, s5, …, s63 Step 2: Mapping Symbols to Subcarriers Assume N sub = 8 subcarriers. Each OFDM symbol in the frequency domain contains 8 QAM symbols (one per subcarrier): Mapping (example) OFDM symbol 1 → s0, s1, s2, s3, s4, s5, s6, s7 OFDM symbol 2 → s8, s9, s10, s11, s12, s13, s14, s15 … OFDM sym...

Power Spectral Density Calculation Using FFT in MATLAB

📘 Overview 🧮 Steps to calculate the PSD of a signal 🧮 MATLAB Codes 📚 Further Reading Power spectral density (PSD) tells us how the power of a signal is distributed across different frequency components, whereas Fourier Magnitude gives you the amplitude (or strength) of each frequency component in the signal. Steps to calculate the PSD of a signal Firstly, calculate the first Fourier transform (FFT) of a signal Then, calculate the Fourier magnitude of the signal The power spectrum is the square of the Fourier magnitude To calculate power spectrum density (PSD), divide the power spectrum by the total number of samples and the frequency resolution. {Frequency resolution = (sampling frequency / total number of samples)} Sampling frequency (fs): The rate at which the continuous-time signal is sampled (in Hz). ...

MATLAB code for BER vs SNR for M-QAM, M-PSK, QPSk, BPSK, ...

🧮 MATLAB Code for BPSK, M-ary PSK, and M-ary QAM Together 🧮 MATLAB Code for M-ary QAM 🧮 MATLAB Code for M-ary PSK 📚 Further Reading MATLAB Script for BER vs. SNR for M-QAM, M-PSK, QPSK, BPSK % Written by Salim Wireless clc; clear; close all; num_symbols = 1e5; snr_db = -20:2:20; psk_orders = [2, 4, 8, 16, 32]; qam_orders = [4, 16, 64, 256]; ber_psk_results = zeros(length(psk_orders), length(snr_db)); ber_qam_results = zeros(length(qam_orders), length(snr_db)); for i = 1:length(psk_orders) psk_order = psk_orders(i); for j = 1:length(snr_db) data_symbols = randi([0, psk_order-1], 1, num_symbols); modulated_signal = pskmod(data_symbols, psk_order, pi/psk_order); received_signal = awgn(modulated_signal, snr_db(j), 'measured'); demodulated_symbols = pskdemod(received_signal, psk_order, pi/psk_order); ber_psk_results(i, j) = sum(data_symbols ~= demodulated_symbols) / num_symbols; end end for i...

Online Channel Impulse Response Simulator

  Fundamental Theory of Channel Impulse Response The fundamental theory behind the channel impulse response in wireless communication often involves complex exponential components such as: \( h(t) = \sum_{i=1}^{L} a_i \cdot \delta(t - \tau_i) \cdot e^{j\theta_i} \) Where: \( a_i \) is the amplitude of the \( i^{th} \) path \( \tau_i \) is the delay of the \( i^{th} \) path \( \theta_i \) is the phase shift (often due to Doppler effect, reflection, etc.) \( e^{j\theta_i} \) introduces a phase rotation (complex exponential) The convolution \( x(t) * h(t) \) gives the received signal So, instead of representing the channel with only real-valued amplitudes, each path can be more accurately modeled using a complex gain : \( h[n] = a_i \cdot e^{j\theta_i} \) 1. Simple Channel Impulse Response Simulator  (Here you can input only a unit impulse signal) Input Signal (Unit Impu...

Calculation of SNR from FFT bins in MATLAB

📘 Overview 🧮 MATLAB Code for Estimation of SNR from FFT bins of a Noisy Signal 🧮 MATLAB Code for Estimation of Signal-to-Noise Ratio from Power Spectral Density Using FFT and Kaiser Window Periodogram from real signal data 📚 Further Reading   Here, you can find the SNR of a received signal from periodogram / FFT bins using the Kaiser operator. The beta (β) parameter characterizes the Kaiser window, which controls the trade-off between the main lobe width and the side lobe level in the frequency domain. For that you should know the sampling rate of the signal.  The Kaiser window is a type of window function commonly used in signal processing, particularly for designing finite impulse response (FIR) filters and performing spectral analysis. It is a general-purpose window that allows for control over the trade-off between the main lobe width (frequency resolution) and side lobe levels (suppression of spectral leakage). The Kaiser window is defined...

Theoretical vs. simulated BER vs. SNR for ASK, FSK, and PSK

📘 Overview 🧮 Simulator for calculating BER 🧮 MATLAB Codes for calculating theoretical BER 🧮 MATLAB Codes for calculating simulated BER 📚 Further Reading BER vs. SNR denotes how many bits in error are received for a given signal-to-noise ratio, typically measured in dB. Common noise types in wireless systems: 1. Additive White Gaussian Noise (AWGN) 2. Rayleigh Fading AWGN adds random noise; Rayleigh fading attenuates the signal variably. A good SNR helps reduce these effects. Simulator for calculating BER vs SNR for binary ASK, FSK, and PSK Calculate BER for Binary ASK Modulation Enter SNR (dB): Calculate BER Calculate BER for Binary FSK Modulation Enter SNR (dB): Calculate BER Calculate BER for Binary PSK Modulation Enter SNR (dB): Calculate BER BER vs. SNR Curves MATLAB Code for Theoretical BER % The code is written by SalimWireless.Com clc; clear; close all; % SNR v...