Open In App

HTML and CSS

Last Updated : 22 May, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

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:

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:

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

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 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
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
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
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
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
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
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
Article Tags :