The Wayback Machine - https://web.archive.org/web/20240901190232/https://www.geeksforgeeks.org/html-css/
Open In App

HTML and CSS

Last Updated : 22 May, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

This article aims to provide you with a thorough understanding of how to use HTML and CSS to construct websites or web pages. Here, we present a complete overview to kickstart your journey in learning HTML and CSS.

What is HTML?

HTML, an acronym for HyperText Markup Language, is the standard language for designing web pages. It is a combination of Hypertext, which establishes the links between web pages, and Markup language, which is used to define the structure of web pages within tags. HTML forms the backbone of any webpage, dictating its structure and content.

Example: Let’s see a small example of a simple HTML page that displays the heading and paragraph content.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>Simple HTML Page</title>
</head>

<body>
    <h1>Welcome to GeeksforGeeks</h1>

    <p>A computer science portal for geeks</p>
</body>

</html>

Output:

Image

Why HTML is used?

  • It is a simple markup language and its implementation is easy.
  • It is used to create a website structure.
  • It helps in developing fundamentals about web programming.

Complete Reference:

HTML Interview Questions

HTML Quiz Set

Recent Articles on HTML


What is CSS?

CSS (Cascading Style Sheets) is a stylesheet language used to design the webpage to make it attractive. The reason for using CSS is to simplify the process of making web pages presentable. CSS allows you to apply styles to web pages. More importantly, CSS enables you to do this independent of the HTML that makes up each web page.

There are three types of CSS which are given below:

  • Inline CSS: In Inline CSS, we add the style to the tags using the “style” attribute inside the tag which we want to design.
  • Internal or Embedded CSS: Internal CSS allows us to style our page by adding the <style> tag inside the <head> tag. Inside the <style> tag, we add the design that we want to give to our page.
  • External CSS: External CSS lets us add style to our HTML page externally. We can add our styles in a different file with extension .css and link this page to our HTML page.

Example:

HTML
<!DOCTYPE html>
<html>
 
<head>
    
    <!-- Stylesheet of web page -->
    <style>
        body {
            text-align: center;
        }
 
        h1 {
            color: green;
        }
    </style>
</head>
 
<body>
    <h1>Welcome to GeeksforGeeks</h1>
 
    <p>A computer science portal for geeks</p>
</body>
 
</html>

Output:

Image

Why CSS is used?

CSS is indispensable in modern web development. It elevates the aesthetic appeal and usability of a website, enhancing user interaction. While it is technically possible to create a website without CSS, the lack of styling would result in a dull and unattractive site. Therefore, mastering CSS is a must for anyone interested in web development.

Complete Reference

CSS Interview Questions and Answers

CSS Quiz Set

Recent Articles on CSS

Some Important Articles on HTML and CSS



Similar Reads

HTML Code to JSON Converter App Using HTML, CSS, and JavaScript
HTML tables are a common way to represent structured data on web pages, but transforming this data into a JSON format can be troublesome. JSON is a lightweight data-interchange format that is easy for humans to read and write and for machines to parse and generate. We will be creating the HTML Code for the JSON Converter tool. The converter is desi
3 min read
Create a CSS Fireflies background using HTML/CSS
In this article, we will see how to create the CSS Fireflies background using HTML &amp; CSS, along with understanding its implementation through the illustration. The CSS fireflies effect can be created by utilizing the CSS animation and we will implement 3 animations to achieve the fireflies effect. To create randomness, we used different animati
7 min read
How to create X and Y axis flip animation using HTML and CSS ?
The flip animation is the kind of loading animation in which we use a square flip effect to give the feel of loading animation. These kinds of animations are useful in times when the content of the website is taking too long to load. This animation can keep visitors engage and prevent them from leaving your web page without seeing the content. The
3 min read
Websites and Software that help HTML, CSS And JavaScript Developers
Developing a website using HTML, CSS, and JS is a time consuming and lengthy process. But using proper resources for the work can accelerate the process. These tools not only make things easier, but you also step it up on the quality level. Here is a list of websites and software that will help you in efficiently building the website: CodePen: Code
3 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 make Incremental and Decremental counter using HTML, CSS and JavaScript ?
While visiting different shopping websites like Flipkart and Amazon you have seen a counter on each product, that counter is used to specify the quantity of that product. Hence, the counter is a very useful part of many websites. In this article, we will design a counter using HTML, CSS, and JavaScript. Output Preview: Approach:First, we will desig
2 min read
Word and Character Counter using HTML CSS and JavaScript
Word and Character Counter is a web application used to count words and characters in a textarea field. HTML, CSS, and JavaScript is used to design the Word and Character Counter. In the textarea field, the user can write anything and this application shows how many words are added by the user and how many characters are added in the text area. App
4 min read
Create a Product Review and Rating System Using HTML CSS and JavaScript
Creating a product review and rating system using HTML, CSS, and JavaScript involves several steps. In this article, we will create a Product Review and Rating System using HTML, CSS, and JavaScript. Approach:Create the HTML structure for your product review and rating system. You'll need sections for product information, user reviews, and a form f
3 min read
Create a Data Export and Import using HTML CSS and JavaScript
In this article, we are going to implement a Data Export and Import Project using HTML CSS &amp; JavaScript. The application we are going to create will allow the user to export their data to a CSV file effortlessly and then import data back from CSV files. Whether you're managing lists or working with spreadsheets, this project will streamline you
3 min read
How to make responsive sliding login and registration form using HTML CSS and JavaScript ?
In this article, we will learn how to make responsive sliding login and registration forms using HTML, CSS, and javascript. Forms are used on webpages for the user to enter their required details that further send to the server for processing. A form is also known as a web form or HTML form. In this article, you will learn to make a responsive slid
4 min read
How to create a drag and drop feature for reordering the images using HTML CSS and jQueryUI ?
In this article, we are given an images gallery and the task is to re-arrange the order of images in the list or grid by dragging and dropping. The jQuery UI framework provides a sortable() function that helps in re-ordering list items by using the mouse. With this functionality, the list items become interchangeable. The jQuery UI provides a sorta
3 min read
Difference between bootstrap.css and bootstrap-theme.css
Bootstrap is an HTML, CSS and JS front-end-framework used for developing responsive and mobile-first projects on the web. It is the framework that comes up with predefined terms, thus giving you the ability to use these codes instead of having to create the codes from scratch. It is a collection of HTML, CSS and JS code that is designed to help bui
5 min read
Difference between CSS Grid and CSS Flexbox
Grid:CSS Grid Layout, is a two-dimensional grid-based layout system with rows and columns, making it easier to design web pages without having to use floats and positioning. Like tables, grid layout allow us to align elements into columns and rows. To get started you have to define a container element as a grid with display: grid, set the column an
4 min read
Using Primer CSS - A Simple and Transparent CSS Library for Web Development
Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation of a document written in HTML or XML. CSS helps you to control the layout and appearance of web pages. In this article, we will discuss the concept of Primer CSS, a CSS library that provides a simple and easy-to-use set of styles for web development. Obvious an
3 min read
How to Play and Pause CSS Animations using CSS Custom Properties ?
In this article, we will see how to control CSS animations using custom properties, along with knowing their implementation through examples. CSS Animations are the automatic transitions that can be made on the web page which lets an element change from one style to another. CSS Custom Properties are variables defined by CSS developers that contain
5 min read
How to create fullscreen search bar using HTML , CSS and JavaScript ?
In this article, you will learn how to create a full-screen search Bar. Here You will be required to create two divs. One for the overlay container and the other for the overlay content container. HTML Code: The first step is to create an HTML file. Here we will create the basic structure for the search bar. Here we will also use an icon for the se
2 min read
Design a Happy Halloween Porter using HTML and CSS
In this article, we will make a 'Happy Halloween Poster' using HTML canvas, along with understanding some of the basic functions provided by canvas in Javascript. Canvas is a digital technique to draw graphics via JavaScript &amp; the elements of the canvas can be used as a container for graphics. Using this, we can draw a line, arc, rectangle, or
3 min read
Slide Down a Navigation Bar on Scroll using HTML, CSS and JavaScript
To create a slide down navigation bar you need to use HTML, CSS, and JavaScript. HTML will make the structure of the body, CSS will make it looks good. This kind of sliding navbar looks attractive on a site. By using JavaScript you can easily make the navigation bar slideable when the user scrolls down. Creating Structure: In this section, we will
4 min read
How to create Right Aligned Menu Links using HTML and CSS ?
The right-aligned menu links are used on many websites. Like hotels website that contains lots of options in the menu section but in case of emergency to make contact with them need specific attention. In that case, you can put all the menu options on the left side of the navigation bar and display contact us option on the right side of the bar. Th
3 min read
Differences between HTML &lt;center&gt; Tag and CSS "text-align: center;" Property
If you are designing a simple web page, then not much difference is noticeable, but it is very necessary to understand the basic differences between these two. Since we are only concerned with the text, these elements do not have separate meanings.HTML &lt;center&gt; tag: The &lt;center&gt; tag in HTML is used to set to align of text into the cente
3 min read
How to Create a Cutout Text using HTML and CSS ?
Cutout text is used as a background header of the webpage. The cutout text creates an attractive look on the webpage. To create a cutout text we will use only HTML and CSS. We display the cutout text and then we make the text blending of an element’s background with the element’s parent. The CSS mix-blend-mode property is required to do that. Divid
3 min read
How to Create Browsers Window using HTML and CSS ?
The browser window is a tool to view the pages from the internet. It is used to search the content on the internet and get relevant information from the internet. Creating Structure: In this section, we will create a basic site structure and also attach the CDN link of the Font-Awesome for the icons which will be used as a menu icon. CDN links for
3 min read
How to Create Breadcrumbs using HTML and CSS ?
Create an attractive Breadcrumbs navigation is quite difficult for NON-CSS experts. Without using CSS, the Breadcrumbs navigation will steal your website's gorgeousness. By using only HTML and CSS we can create an attractive Breadcrumbs navigation. In this article, the main focus will be CSS. We will create the structure for the breadcrumbs first a
4 min read
How to Create a Wave Image for a Background using HTML and CSS ?
This type of background creates uniqueness on your webpage by avoiding regular rectangular sized background or header. The following header design will show your creativity. This design can be achieved in two ways: Using ::before and ::after selector on a div element in CSS.Using SVG in HTML. Example: This example uses ::before and ::after selector
3 min read
How to Create Full Screen Overlay Navigation Bar using HTML CSS and JavaScript ?
Create a full screen Navigation Bar: In this article, you will learn how to create a full-screen navbar for your website. There are three methods to create a full screen overlay navigation bar which are listed below: From Left From top No animation- Just show You will be required to create two divs. One for the overlay container and the other for t
4 min read
How to Create Liquid Filling Effect on Text using HTML and CSS ?
The liquid fill text animation can be done using CSS | ::before selector. We will use key frames to set height for each frame of animation. Please make sure you know about both CSS | ::before selector and CSS | @keyframes Rule before try this code.The basic styling of the text can be done differently that totally depends on you how you want your te
3 min read
How to create Neon Light Button using HTML and CSS ?
The neon light button animation effect can be easily generated by using HTML and CSS. By using HTML we will design the basic structure of the button and then by using the properties of CSS, we can create the neon light animation effect. HTML code: In this section, we will design a simple button structure using anchor tag. C/C++ Code &lt;!DOCTYPE ht
2 min read
How to create paper corner fold effect on hover by using HTML and CSS?
The folding effect is quite attractive on the website, may you have seen on some websites when you hover on the paging layout it gets folded on the corner. The folding corner effect can be achieved by using HTML and CSS only. The below sections will guide you on how to create the animation. In this article, we will divide the article into two secti
3 min read
How to make a glass/blur effect overlay using HTML and CSS ?
To give a background blur effect on an overlay, the CSS's backdrop-filter: blur() property is used with ::before pseudo-element. The “backdrop-filter: blur()” property gives the blur effect on the box or any element where it is desired and “before” is used to add the blurred background without applying any extra markup. HTML Code: In this section,
3 min read
How to Create an Effect to Change Button Color using HTML and CSS ?
The color-changing effect of a button is very common but what we are going to do a slightly advanced version of this effect. The background will change like a clip effect rotating at some particular angle. Approach: The approach is to provide two or three background and then rotating them on different angles. HTML Code: In this section, we will use
3 min read
Article Tags :