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, ...(MATLAB Code + Simulator)

📘 Overview of BER and SNR 🧮 Online Simulator for BER calculation 🧮 MATLAB Code for BER calculation 📚 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 compared to the total number of bits sent. BER = (number of bits received in error) / (total number of transmitted bits) What is Signal-to-Noise Ratio (SNR)? SNR is the ratio of signal power to noise powe...

Comparing Baseband and Passband Implementations of m-ary QAM

  Let's assume your original digital message bitstream is: 0, 0, 1, 0, 0, 0, 1, 0, 1, 1 In 4-QAM, we group them into pairs: (00), (10), (00), (10), (11). Your baseband symbols are: Symbol 1 (Bits 00): -1.00 - j1.00 Symbol 2 (Bits 10): 1.00 - j1.00 Symbol 3 (Bits 00): -1.00 - j1.00 Symbol 4 (Bits 10): 1.00 - j1.00 Symbol 5 (Bits 11): 1.00 + j1.00   To transmit these symbols over a wireless medium, we modulate this baseband signal onto a high-frequency carrier (e.g., 50 Hz). This process creates the passband signal , where the information is stored in the phase and amplitude of the sine wave. Fig 1: 4-QAM Baseband I and Q Components Fig 2: 4-QAM Passband Modulated Signal   In this example, the symbol rate is 5 symbols per second. Detailed Explanation 4-QAM Constellation Mapping In standard 4-QAM mapping, bits are converted to complex points on a grid: Bits...

Comparing Baseband and Passband Implementations of ASK, FSK, and PSK

📘 Overview 🧮 Baseband and Passband Implementations of ASK, FSK, and PSK 🧮 Difference betwen baseband and passband 📚 Further Reading 📂 Other Topics on Baseband and Passband ... 🧮 Baseband modulation techniques 🧮 Passband modulation techniques   Baseband modulation techniques are methods used to encode information signals onto a baseband signal (a signal with frequencies close to zero). Passband techniques shift these signals to higher carrier frequencies for transmission. Here are the common implementations: Amplitude Shift Keying (ASK) [↗] : In ASK, the amplitude of the signal is varied to represent different symbols. Binary ASK (BASK) is a common implementation where two different amplitudes represent binary values (0 and 1). ASK is simple but susceptible to noise. ASK Baseband (Digital Bits) ASK Passband (Modulated Carrier)     Fig 1:  ASK Passband Modulation (...

Shannon Limit Explained: Negative SNR, Eb/No and Channel Capacity

Understanding Negative SNR and the Shannon Limit Understanding Negative SNR and the Shannon Limit An explanation of Signal-to-Noise Ratio (SNR), its behavior in decibels, and how Shannon's theorem defines the ultimate communication limit. Signal-to-Noise Ratio in Shannon’s Equation In Shannon's equation, the Signal-to-Noise Ratio (SNR) is defined as the signal power divided by the noise power: SNR = S / N Since both signal power and noise power are physical quantities, neither can be negative. Therefore, the SNR itself is always a positive number. However, engineers often express SNR in decibels: SNR(dB) When SNR = 1, the logarithmic value becomes: SNR(dB) = 0 When the noise power exceeds the signal power (SNR < 1), the decibel representation becomes negative. Behavior of Shannon's Capacity Equation Shannon’s channel capacity formula is: C = B log₂(1 + SNR) For SNR = 0: log₂(1 + SNR) = 0 When SNR becomes smaller (in...

Amplitude, Frequency, and Phase Modulation Techniques (AM, FM, and PM)

📘 Overview 🧮 Amplitude Modulation (AM) 🧮 Online Amplitude Modulation Simulator 🧮 MATLAB Code for AM 🧮 Q & A and Summary 📚 Further Reading Amplitude Modulation (AM): The carrier signal's amplitude varies linearly with the amplitude of the message signal. An AM wave may thus be described, in the most general form, as a function of time as follows: When performing amplitude modulation (AM) with a carrier frequency of 100 Hz and a message frequency of 10 Hz, the resulting peak frequencies are as follows: 90 Hz (100 - 10 Hz), 100 Hz, and 110 Hz (100 + 10 Hz). Figure: Frequency Spectrums of AM Signal (Lower Sideband, Carrier, and Upper Sideband) A low-frequency message signal is modulated with a high-frequency carrier wave using a local oscillator to make communication possible. DSB, SSB, and VSB are common amplitude modulation techniques. We find a lot of bandwidth loss in DSB. The bandwidth of S...

Analog vs Digital Modulation Techniques | Advantages of Digital ...

Modulation Techniques Analog vs Digital Modulation In our previous discussion, we explored the necessity of modulation. In this article, we focus on the fundamental differences between analog and digital modulation. The primary distinction is that digital modulation uses a discrete digital signal to modify the carrier, whereas analog modulation uses a continuous analog signal. Advantages of Digital Modulation over Analog Modulation Bandwidth Efficiency: Digital techniques (like QAM) can transmit more data within a limited frequency range. Noise Resistance: Digital signals have superior resistance to noise because they can be perfectly regenerated. Multiplexing: It is much easier to multiplex various data types (audio, video, text) into a single digital stream. Higher SNR: Better noise immunity leads to a higher Signal-to-Noise Ratio (SNR). Increased Throughput: Modern digital techniques provide significantly higher data ...

ASK, FSK, and PSK (with MATLAB + Online Simulator)

📘 Overview 📘 Amplitude Shift Keying (ASK) 📘 Frequency Shift Keying (FSK) 📘 Phase Shift Keying (PSK) 📘 Which of the modulation techniques—ASK, FSK, or PSK—can achieve higher bit rates? 🧮 MATLAB Codes 📘 Simulator for binary ASK, FSK, and PSK Modulation 📚 Further Reading ASK or OFF ON Keying ASK is a simple (less complex) Digital Modulation Scheme where we vary the modulation signal's amplitude or voltage by the message signal's amplitude or voltage. We select two levels (two different voltage levels) for transmitting modulated message signals. For example, "+5 Volt" (upper level) and "0 Volt" (lower level). To transmit binary bit "1", the transmitter sends "+5 Volts", and for bit "0", it sends no power. The receiver uses filters to detect whether a binary "1" or "0" was transmitted. ...

Online Simulator for ASK, FSK, and PSK

Try our new Digital Signal Processing Simulator!   Start Simulator for binary ASK Modulation Message Bits (e.g. 1,0,1,0) Carrier Frequency (Hz) Sampling Frequency (Hz) Run Simulation Simulator for binary FSK Modulation Input Bits (e.g. 1,0,1,0) Freq for '1' (Hz) Freq for '0' (Hz) Sampling Rate (Hz) Visualize FSK Signal Simulator for BPSK Modulation ...