Foundations of computing
Foundations of computing
Example: This example shows the basic use of HTML on the web browser.
HTML
<!DOCTYPE html>
<html>
<head>
<title>HTML Tutorial</title>
</head>
<body>
<h2>Welcome To GFG</h2>
<p>Hello World! Hello from GFG </p>
</body>
</html>
What is CSS?
CSS or Cascading Style Sheets is a stylesheet language used to add styles to
the HTML document. It describes how HTML elements should be displayed on
the web page.
CSS was first proposed by Håkon Wium Lie in 1994 and later developed by
Lie and Bert Bos, who published the CSS1 specification in 1996.
<!DOCTYPE html>
<html>
<head>
<!-- Importing External CSS -->
<link rel="stylesheet" href="style.css" />
<!-- Using Internal CSS -->
<style>
h2 {
color: green;
}
</style>
</head>
<body>
<!-- Using Inline CSS -->
<h2 style="text-align: center;">Welcome To GFG</h2>
<p>Showing all type of CSS use - GeeksforGeeks</p>
</body>
</html>
What is JavaScript?
JavaScript is a lightweight, cross-platform, single-threaded, and interpreted
compiled programming language. It is also known as the scripting language for
webpages. It is well-known for the development of web pages, and many non-
browser environments also use it.
JavaScript is a weakly typed language (dynamically typed). JavaScript can be
used for Client-side developments as well as Server-side developments.
JavaScript is both an imperative and declarative type of language. JavaScript
contains a standard library of objects, like Array, Date, and Math, and a core
set of language elements like operators, control structures, and statements.
Example: This example shows the alert by the use of alert method provided by
JavaScript.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<title>Custom Alert Box</title>
<style>
body {
display: flex;
justify-content: center;
width: 100vw;
margin-top: 20px;
}
.alert {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #f8d7da;
color: #721c24;
padding: 15px 20px;
border: 1px solid #f5c6cb;
border-radius: 5px;
}
</style>
</head>
<body>
<button onclick="showAlert()">Show Alert</button>
<script>
function showAlert() {
XHTML
HTML XHTML
XML parsers
Application of Standard
Generalized Markup Language Application of XML
(SGML).