The Wayback Machine - https://web.archive.org/web/20241001114201/https://www.geeksforgeeks.org/design-a-webpage-like-technical-documentation-using-html-css/
Open In App

Design a Webpage like Technical Documentation using HTML and CSS

Last Updated : 01 Aug, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In this article, we will design a webpage-like technical documentation using HTML and CSS . Technical documentation is any document that explains the features of the respective product. In this project, we are going to create technical documentation of C++ by using HTML and CSS. The webpage has a menu section that helps to navigate to different sections of the webpage.

Approach:

  • Structure the webpage into two sections: left for a Documentation Menu and right for topic descriptions.
  • Create anchor tags in the left section to serve as navigation links, linking to corresponding IDs on the right (e.g., inheritance, polymorphism).
  • Enable dynamic loading of topic details on the right side when users click on a link in the Documentation Menu.
  • Enhance the web page’s visual appeal using CSS for text alignment, padding, margin, and overall design aesthetics.
  • Implement responsive design with CSS to adapt the layout for different screen sizes.

Example:

HTML Code
<!DOCTYPE html>
<html lang="en">
<head>
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <div class="main-body">
        <nav id="navbar">
            <header>Documentation Menu</header>
            <a href="#Intro" class="nav-link">
                What is C++</a>
            <a href="#Object" class="nav-link">
                Objects and Classes</a>
            <a href="#Inheritance" class="nav-link">
                Inheritance</a>
            <a href="#Polymorphism" class="nav-link">
                Polymorphism</a>
            <a href="#Abstraction" class="nav-link">
                Abstraction</a>
            <a href="#Encapsulation" class="nav-link">
                Encapsulation</a>
        </nav>

        <main id="main-doc">
            <section class="main-section" id="Intro">
                <header>
                    What is C++?
                </header>
                <p>
                    C++ is a general purpose programming
                    language and widely used now a days '
                    for competitive programming. It has
                    imperative, object-oriented and generic
                    programming features. C++ runs on lots of
                    platform like Windows, Linux, Unix, Mac etc.
                    C++ is an efficient
                    and powerful language and finds wide use
                    in various GUI platforms, 3D graphics and
                    real-time simulations. Because of the
                    inclusion of rich function libraries,
                    working in C++ becomes simpler and
                    convenient than C. Being object-oriented
                    programming like Java, C++ provides
                    the support of inheritance, polymorphism,
                    encapsulation, etc. Unlike C, C++ allows
                    exception handling and function overloading.
                </p>
                <p>he “Hello World” program is the first
                    step towards learning any programming
                    language and also one of the simplest
                    programs you will learn. All you have
                    to do is display the message “Hello World”
                    on the screen.
                    <br><br>Let us now look at the program :<br>
                </p>
                <code>
                    #include<iostream>  
                    <br>
                    using namespace std;  
                    <br>
                    int main() 
                    <br>
                        { 
                            <br>
                            cout〈〈"Hello World"; 
                            <br>
                            return 0; 
                            <br>
                        } 
                </code>
                <br>
                <p>C++ is an Object Oriented Programming Language.
                    <br> The main pillars of Object Oriented
                    Programming are :
                </p>
                <ul>
                    <li>Objects and Classes</li>
                    <li>Inheritance</li>
                    <li>Polymorphism</li>
                    <li>Abstraction</li>
                    <li>Encapsulation</li>
                </ul>
            </section>

            <section class="main-section" id="Object">
                <header>
                    Objects and Classes
                </header>
                <p>
                    Object-oriented programming – As the name
                    suggests uses objects in programming.
                    Object-oriented programming aims to
                    implement real-world entities like
                    inheritance, hiding, polymorphism,
                    etc in programming. The main
                    aim of OOP is to bind together the data
                    and the functions that operate on them
                    so that no other part of the code can
                    access this data except that function.
                </p>
                <p><b>Object : </b>An Object is an identifiable
                    entity with some characteristics and behavior.
                    An Object is an instance of a Class. When a
                    class is defined, no memory is allocated but
                    when it is instantiated (i.e. an
                    object is created) memory is allocated.
                    <br>
                    <b>Class : </b>The building block of C++ that
                    leads to Object-Oriented programming is a Class.
                    It is a user-defined data type, which holds its
                    own data members and member functions, which can
                    be accessed & used by creating an instance
                    of that class. A class is like a blueprint for
                    an object. For Example: Consider the Class
                    of Cars. There may be many cars with different
                    names and brand but all of them will share
                    some common properties like all of them will
                    have 4 wheels, Speed Limit, Mileage range etc.
                    So here, Car is the class and wheels,
                    speed limits, mileage are their properties.
                </p>
            </section>

            <section class="main-section" id="Inheritance">
                <header>
                    Inheritance
                </header>
                <p>
                    The capability of a class to derive
                    properties and characteristics from
                    another class is called Inheritance.
                    Inheritance is one of the most important
                    feature of Object Oriented Programming.
                    Sub Class: The class that inherits
                    properties from another class
                    is called Sub class or Derived Class.
                    Super Class: The class whose properties
                    are inherited by sub class is called Base
                    Class or Super class. Using inheritance, we
                    have to write the functions only one time
                    instead of three times as we
                    have inherited rest of the three classes
                    from base class(Vehicle).
                </p>
                <p> 
                    <b>Mode of Inheritance : </b><br><br>

                    <b>Public Mode : </b>If we derive a sub
                    class from a public base class. Then the
                    public member of the base class will
                    become public in the derived class and
                    protected members of the base class
                    will become protected in derived class.
                    <br><br>
                    <b>Protected Mode : </b>If we derive a
                    sub class from a Protected base class.
                    Then both public member and protected
                    members of the base class will become
                    protected in derived class.
                    <br><br>
                    <b>Private Mode : </b>If we derive a
                    sub class from a Private base class.
                    Then both public member and protected
                    members of the base class will become
                    Private in derived class.
                    <br><br>
                    <b>Types of Inheritance in C++ : </b>
                    <br><br><br>
                    <b>Single Inheritance :</b> In single
                    inheritance, a class is allowed to inherit
                    from only one class. i.e. one sub class
                    is inherited by one base class only.
                    <br><br>
                    <b>Multiple Inheritance :</b> Multiple
                    Inheritance is a feature of C++ where a
                    class can inherit from more than one
                    classes. i.e one sub class is inherited
                    from more than one base classes.
                    <br><br>
                    <b>Multilevel Inheritance :</b> In this
                    type of inheritance, a derived class is
                    created from another derived class.
                    <br><br>
                    <b>Hieratical Inheritance :</b> In this
                    type of inheritance, more than one sub
                    class is inherited from a single base
                    class i.e. more than one derived class
                    is created from a single base class.
                    <br><br>
                    <b>Hybrid (Virtual) Inheritance :</b>
                    Hybrid Inheritance is implemented by
                    combining more than one type of
                    inheritance.
                    For example: Combining Hierarchical
                    inheritance and Multiple Inheritance.
                </p>
            </section>

            <section class="main-section" id="Polymorphism">
                <header>
                    Polymorphism
                </header>
                <p>
                    The word polymorphism means having many
                    forms. In simple words, we can define
                    polymorphism as the ability of a message
                    to be displayed in more than one form.
                    A real-life example of polymorphism, a
                    person at the same time can have
                    different characteristics.
                    Like a man at the same time is a father,
                    a husband, an employee. So the same
                    person posses different behavior in
                    different situations. This is called
                    polymorphism. Polymorphism is considered
                    as one of the important features of Object
                    Oriented Programming.
                    <br>
                    <b>In C++ polymorphism is mainly
                        divided into two types:</b>
                    <br> 1. Compile time Polymorphism<br>
                    2. Runtime Polymorphism
                </p>

                <p>Compile time polymorphism: This type of
                    polymorphism is achieved by function
                    overloading or operator overloading.
                    <br> Runtime polymorphism: This type
                    of polymorphism is achieved by
                    Function Overriding.
                </p>
            </section>

            <section class="main-section" id="Abstraction">
                <header>
                    Abstraction
                </header>

                <p>
                    Data abstraction is one of the most
                    essential and important feature of object
                    oriented programming in C++. Abstraction
                    means displaying only essential information
                    and hiding the details. Data abstraction
                    refers to providing only essential information
                    about the data to the outside world,
                    hiding the background details or implementation.
                    <br> Consider a real life example of a man driving
                    a car. The man only knows that pressing the
                    accelerators will increase the speed of car
                    or applying brakes will stop the car but he
                    does not know about how on pressing accelerator
                    the speed is actually increasing, he does
                    not know about the inner mechanism of the car
                    or the implementation of accelerator, brakes
                    etc in the car. This is what abstraction is.
                </p>

                <p>
                    <b>Abstraction using Classes:</b> We can
                    implement Abstraction in C++ using classes.
                    Class helps us to group data members and member
                    functions using available access specifiers. A
                    Class can decide which data member will be
                    visible to outside
                    world and which is not.
                    <br>
                    <b>Abstraction in Header files:</b> One
                    more type of abstraction in C++ can be
                    header files. For example, consider the
                    pow() method present in math.h header file.
                    Whenever we need to calculate power of a
                    number, we simply call the
                    function pow() present in the math.h header
                    file and pass the numbers as arguments
                    without knowing the underlying algorithm
                    according to which the function is actually
                    calculating power of numbers.
                    <br><br><b>Advantages of Data Abstraction:

                    </b><br> 1. Helps the user to avoid writing
                    the low level code.<br> 2. Avoids code
                    duplication and increases reusability.<br>
                    3. Can change internal implementation of
                    class independently without
                    affecting the user.<br> 4. Helps to
                    increase security of an application or program
                    as only important details are
                    provided to the user.
                </p>
            </section>

            <section class="main-section" id="Encapsulation">
                <header>
                    Encapsulation
                </header>
                <p>
                    In normal terms Encapsulation is defined
                    as wrapping up of data and information
                    under a single unit. In Object Oriented
                    Programming, Encapsulation is defined as
                    binding together the data and the functions
                    that manipulates them. Consider
                    a real life example
                    of encapsulation, in a company there are
                    different sections like the accounts section,
                    finance section, sales section etc. The finance
                    section handles all the financial transactions
                    and keep records of all the data related to
                    finance.
                    Similarly the sales section handles all the
                    sales related activities and keep records of
                    all the sales. Now there may arise a situation
                    when for some reason an official from finance
                    section needs all the data about sales in a
                    particular
                    month. In this case, he is not allowed to
                    directly access the data of sales section.
                    He will first have to contact some other
                    officer in the sales section and then
                    request him to
                    give the particular data. This is what
                    encapsulation is. Here the data of
                    sales section and the
                    employees that can manipulate them are
                    wrapped under a single name “sales section”.
                </p>

                <p>
                    Encapsulation also lead to data abstraction
                    or hiding. As using encapsulation also hides
                    the data. In the above example the data of
                    any of the section like sales, finance or
                    accounts is hidden from any other section.<br>
                    In C++ encapsulation
                    can be implemented using Class
                    and access modifiers.
                </p>
            </section>
        </main>
    </div>
</body>
</html>
CSS
div.main-body {
    display: grid;
    grid-template-columns: minmax(300px, auto)1fr;
    grid-template-areas: "navbar mainContent";
    grid-gap: 20px;
}

nav#navbar {
    grid-area: navbar;
    position: fixed;
}

nav#navbar a {
    display: block;
    border: 1px solid black;
    padding: 5px;
    margin: 10px 0;
    text-decoration: none;
    color: black;
}

main#main-doc {
    grid-area: mainContent;
}

header {
    font-size: 1.5rem;
    font-weight: bold;
}

code {
    background-color: #CCC;
    display: block;
    padding: 20px;
};

Output:

image

Structured output image



Previous Article
Next Article

Similar Reads

Design a transparent login/Sign Up webpage using HTML and CSS
Project Introduction: In this article, we will discuss how to design a transparent login webpage using HTML and CSS. Project Structure: index.htmlstyle.css index.html Explanation: We have put the login form in a class called container and we have placed each input tag in a separate div with class row so that each input tag occupies the full line. W
3 min read
Design an Event Webpage using HTML and CSS
Events webpage plays a vital role in promoting and booking an event. In this article, we are going to build an event page, it will contain the details of the events like dates, booking options, and view more details button. We will use HTML to give the basic layout like title, details, buttons, etc. and CSS will give a beautiful design to our layou
6 min read
Design a webpage for online food delivery system using HTML and CSS
To design an attractive webpage for an online food delivery system using HTML and CSS, craft a user-friendly interface with navigation, engaging content sections, and responsive design to enhance the overall dining experience. Also add the basic pages "Home," "About," "Menu," and "Contact Us," featuring the company logo "Online FoodShop". Preview I
6 min read
Design a Parallax Webpage using HTML and CSS
A parallax website includes fixed images in the background that are kept in place and the user can scroll down the page to see different parts of the image. In this article, we are creating a parallax webpage using HTML and CSS. We will use basic tags of HTML like div, paragraph, and heading to write our content and will use CSS to align and beauti
4 min read
How to Design Homepage like Facebook using HTML and CSS ?
HTML:  HTML stands for Hyper Text Markup Language. It is used to design web pages using a markup language. HTML is the combination of Hypertext and Markup language. Hypertext defines the link between the web pages. A markup language is used to define the text document within tag which defines the structure of web pages. CSS: Cascading Style Sheets,
3 min read
How to use Google material icon as list-style in a webpage using HTML and CSS ?
Icons can be added to our HTML page from the icon library. All the icons in the library can be formatted using CSS. They can be customized according to size, colour, shadow, etc. They play a considerate part in materialize CSS. Materialize CSS provides a rich set of material icons of google which can be downloaded from Material Design specs. Librar
2 min read
How to create Pay Role Management Webpage using HTML CSS JavaScript ?
In this article, we are going to make a Pay Role Management webpage with Javascript. In this project, we are going to learn and clear the concepts of basic javascript. Prerequisites: The pre-requisites for this project are- ES6 JavaScriptQuery SelectorsApproach: To create our Pay Role Management webpage we are going to take the input bill amount an
6 min read
Create Documentation Template using React and Tailwind CSS
This documentation template serves as a comprehensive guide for developers to understand the setup configuration and functionalities of the project. We are going to build the Documentation Template using React and Tailwind CSS. PrerequisitesReact.jsTailwind CSSNode.js npmReact IconsApproachTo create a documentation template using React and Tailwind
4 min read
How to design complex layout for webpage using jQuery EasyUI ?
EasyUI is a HTML5 framework for using user interface components based on jQuery, React, Angular and Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of time for developers. In this article, we will learn to design the basic and complex layout for any webpage using jQuery EasyUI plugin. Downloa
5 min read
How to design menu on right click of webpage using jQuery EasyUI ?
EasyUI is a HTML5 framework for using user interface components based on jQuery, React, Angular and, Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of time for developers. It helps in building features for interactive web and mobile applications saving a lot of time for developers. Download
3 min read
How to design checkbox selection for webpage using jQuery EasyUI ?
EasyUI is a HTML5 framework for using user interface components based on jQuery, React, Angular and Vue technologies. It helps in building features for interactive web and mobile applications saving a lot of time for developers. In this article, we will learn to design single and multiple select checkboxes using jQuery EasyUI plugin. Downloads for
3 min read
Hide the cursor in a webpage using CSS and JavaScript
In this article, we are going to learn how to Hide the cursor on a webpage using CSS and JavaScript. ApproachFirst, select the element where the cursor element needs to hide.Add CSS style cursor: none to the class.Add the class name (class name of CSS style cursor: none) to the particular element where the cursor element is to be hidden.Example 1:
2 min read
Create a Like and Dislike Toggle using HTML and CSS
Creating a Toggle "Like" and "Dislike" button involves using HTML and CSS to structure and style the buttons. We will use the font awesome icon for the like/dislike button. We will use Font Awesome Icon to create like and dislike buttons with the help of HTML, and CSS to add styles on the button. To Toggle the Like/Dislike button, we will use JavaS
2 min read
How to Add Apple's new San Francisco font on a Webpage using CSS ?
The newly created Apple's San Francisco font is comfortable for human eyes as per research. Normally Apple's font can not be used on any webpage through CSS. These kind of fonts are in-build in Apple's product but the new San Francisco font can be used in any web content. Mr. Craig Hockenberry introduces the procedure of how we can use that font on
2 min read
How to create printable webpage using CSS media queries ?
The media query is used to hide/show an element when printing the web pages. Use @media print query and set the visibility property to that element that needs to hide/show at printing. In this article, we use media query and visibility property to print the web page. Example 1: In this example, we will print the body element at printing time. To hi
2 min read
How to hide the insertion caret in a webpage using CSS ?
Insertion caret or text input cursor generally refers to a flashing, thin vertical line. It functions in an input field to indicate where the next character typed will be inserted. If you wish to hide this input cursor from input fields in your webpage, the caret-color property of CSS is used. It has three property values including auto, color, and
1 min read
How to align image vertically in a division that spans vertically on the whole webpage using CSS ?
In this article, we will discuss the vertical alignment of images in a single division that spans vertically on the whole webpage. Vertical alignment of images refers to placing the images in a column. We often need to align the image vertically in order to display it properly on the mobile version or sometimes, we don't want to insert a horizontal
3 min read
Recommend a way to optimize a certain webpage for prints using CSS
In this article, we are going to see how we can optimize a webpage for prints. Using CSS and media query in it we are going to achieve the task. Printing a webpage is a very common practice and users can print a webpage for various reasons like storing data, some information that needs to be printed like tickets, etc. Approach: Using the "@media pr
2 min read
Design a Like and Dislike Toggle Button in Tailwind CSS
The Like and Dislike Toggle in Tailwind CSS is used for gathering user feedback on content, products, or services with better interaction. Creating a like/dislike toggle button with Tailwind CSS, a powerful utility-based framework. It readers through the process of creating customizable toggle buttons, complete with responsive design. Output Previe
2 min read
How to generate API documentation using Postman?
Postman is a popular API testing tool that is used to simplify the process of developing and testing APIs (Application Programming Interface). API acts as a bridge between two software applications which enables them to communicate and share data. In this article, you will learn how to generate API documentation using Postman. PrerequisitesUndersta
2 min read
Streamlining API Documentation Using Postman
APIs (Application Programming Interfaces) are the backbone of interconnected software, enabling different applications to work together. As developers build more APIs, the need for clear and accessible documentation becomes more important. Good documentation ensures that others can easily understand and use your APIs. Postman, a tool many developer
5 min read
How to redirect to another webpage in HTML?
It is often required to redirect to another webpage on loading a webpage, for example, due to the contents being moved to the new webpage. Demonstrated here are two simple methods to redirect to another webpage on load. Method-1: Using http-equiv attribute of the meta tag in HTML. Syntax: <meta http-equiv="refresh" content="seconds; url=URL">
2 min read
How to add Flash content within a webpage in HTML?
Flash is a vector animation software that was created with the intention of creating animations for web pages. Because vector graphics are so light, they are perfect for the web. There are different ways to insert a Flash file in HTML. Method-1: Using object and embed tag: The web standard for embedding content on a web page is the <object> t
2 min read
Which attribute is used to target the webpage to open into a new window in HTML ?
HTML (Hyper Text Markup Language) plays the most significant role in website development. But when it comes to good user experience and easy navigation then the <a> tag is used. In this article, we will discuss the hyperlink tag, its possible attributes, and how a user can open a web page in a new window in HTML. IntroductionThe target attrib
2 min read
How to create a nested webpage in HTML ?
When the content of one completely different webpage is embedded into another webpage, it is called a nested webpage. In simple words, a webpage that is inside another webpage of a completely different domain. In this article, we are going to learn how to create a nested webpage. There are two methods to create a nested webpage. Table of Content Us
2 min read
How to add file uploads function to a webpage in HTML ?
Adding a file upload function to a webpage in HTML allows users to select and upload files from their device to a server. This is achieved using the <input type="file"> element within a form, enabling file selection and submission for processing or storage. Table of Content Using Single File UploadUsing Multiple File UploadUsing Single File U
2 min read
API documentation in Postman: Purpose and Benefits
Postman is an API(utility programming interface) development device that enables to construct, take a look at and alter APIs. It could make numerous varieties of HTTP requests(GET, POST, PUT, PATCH), store environments for later use, and convert the API to code for various languages(like JavaScript, and Python). Purpose1. Clarity and Understanding:
4 min read
Documentation Comments in JSDoc
In JSDoc we need to include documentation comments in the code through which JSDoc will generate an HTML documentation website. Let's see how to create documentation comments for different types of code. String, Numbers & Arrays: C/C++ Code /** * Site Name * @type {string} */ const siteName = "GeeksForGeeks"; /** * Number * @type {num
4 min read
How To Write Good API Documentation?
API (Application Programming Interface) documentation is important for developers to understand how to interact with your API effectively. Good API documentation can make the difference between an API that is easy to use and one that is frustrating, leading to poor adoption rates. This article will explore key components and best practices for writ
4 min read
How To Write API Documentation For Optimal User Success?
Writing API documentation is very important in order to give a complete guide to an API user - How to use that API? What are the features provided by that API ? and also what are the dependencies involved in that API integration? and Writing effective API documentation is important for ensuring that developers can easily understand and use your API
7 min read