Hello Friends welcome to the FreeSiteTools website. If you want to know about what is HTML, CSS & Javascripts. So Today i am telling about what is HTML code, CSS & Javascripts.
What is HTML Code ?
HTML (Hypertext Markup Language) is a markup language used for creating web pages and other types of online content. HTML code consists of a series of elements, which are enclosed in angle brackets (< >) and typically come in pairs, with a start tag and an end tag.
Here is an example of a simple HTML document that includes a heading, a paragraph, and an image:
php<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
</head>
<body>
<h1>Welcome to My Web Page</h1>
<p>This is a paragraph of text.</p>
<img src="image.jpg" alt="An example image">
</body>
</html>
In this example, the '<!DOCTYPE html>'
declaration specifies that the document is an HTML5 document. The '<html>'
element is the root element of the document, and it contains two child elements: the '<head>'
element, which contains metadata about the document, and the '<body>'
element, which contains the content of the document.
<title>'
element inside the '<head>'
element specifies the title of the web page, which is displayed in the browser's title bar. The '<h1>'
element inside the '<body>'
element specifies a top-level heading, and the '<p>'
element specifies a paragraph of text. Finally, the '<img>'
element specifies an image with a 'src'
attribute that points to the image file, and an 'alt'
attribute that provides alternative text for the image.What is CSS ?
CSS stands for Cascading Style Sheets. It is a stylesheet language used for describing the presentation of a document written in HTML or XML (including various XML languages like SVG or XHTML). CSS is used to style and format the layout of web pages and user interfaces, including fonts, colors, margins, padding, and positioning.
CSS works by using selectors to target specific elements on a web page and then applying rules to those elements. The rules can specify various properties, such as font-size, color, background-color, and more. CSS also supports various layout and positioning techniques, such as floats, grids, and flexboxes, to control the positioning of elements on a page.
What is Javascript ?
JavaScript is a high-level programming language used primarily for creating dynamic, interactive web pages and applications. It is a client-side scripting language, meaning that it runs in a user's web browser rather than on a web server.
javascript// Select the button element
const myButton = document.querySelector('#my-button');
// Add an event listener to the button
myButton.addEventListener('click', function() {
// Display an alert box
alert('Hello, world!');
});
In this example, the 'querySelector'
method is used to select the button element with an 'id'
of 'my-button'
. The 'addEventListener'
method is then used to add a click event listener to the button, which displays an alert box when the button is clicked. This is just a simple example, but JavaScript can be used for much more complex tasks and projects.