Posts

Showing posts from September, 2024

XHTML (Extensible Hypertext Markup Language).

Image
XHTML is a more stringent version of HTML, which is based on XML (Extensible Markup Language). Unlike HTML, which allows some flexibility in how tags are written, XHTML has stricter syntax rules that make it more compatible with modern web technologies and XML-based tools. Key Features of XHTML XML Compliance: XHTML is based on XML, meaning it follows stricter rules and is case-sensitive. Every tag and attribute in XHTML must be written in lowercase, and all elements must be properly closed. Well-formed Structure: In XHTML, all tags must be properly nested and closed. For example, <br /> (line break) must always be self-closing, unlike HTML where <br> is acceptable without the /. Document Structure: XHTML follows a stricter, well-formed structure, where you need to properly define the DOCTYPE declaration at the beginning and always close your tags properly. Use of Attributes: In XHTML, all attributes must have values enclosed in double quotes (" "). For example, i...

Basics of HTML

  Getting Started with HTML: Essential Elements and Examples HTML (Hypertext Markup Language) is the foundation of web development. It provides the structure and layout of web pages and helps to define elements like headings, paragraphs, links, and images. In this blog post, we’ll explore the essential HTML elements with example code to help you start building your own web pages. 1. Basic Structure of an HTML Document Every HTML document has a standard structure, beginning with the <!DOCTYPE html> declaration and followed by html , head , and body tags. Here’s the basic structure of an HTML file: <!DOCTYPE html> <html> <head>     <title>My First Web Page</title> </head> <body>     <h1>Welcome to HTML Basics</h1>     <p>This is a paragraph on my first webpage.</p> </body> </html> <!DOCTYPE html> : Declares the document type as HTML5. <html> : The root eleme...

Basics of CSS

  Introduction to CSS: Styling the Web CSS (Cascading Style Sheets) is a styling language used to describe the look and formatting of HTML documents. With CSS, we can control the layout, colors, fonts, spacing, and more, making our websites attractive and user-friendly. Key Concepts in CSS Selectors : CSS selectors target HTML elements to apply specific styles. Properties and Values : Each CSS rule consists of a property (like color or font-size) and a value. CSS Syntax : Basic CSS syntax involves a selector, followed by curly braces {} , containing property-value pairs. CSS Syntax A CSS rule has the following syntax: selector {     property: value; } For example: h1 {     color: blue;     font-size: 24px; } Ways to Add CSS Inline CSS : Add CSS directly to an HTML element using the style attribute. Internal CSS : Use the <style> tag within the HTML <head> . External CSS : Link a CSS file using <link rel="stylesheet" href="style.css"...

Basics of JavaScript

 JavaScript is a powerful, versatile language used for adding interactivity to websites. If you're just starting with web development, JavaScript is an essential tool in your toolkit. In this post, we’ll cover the basics of JavaScript, including how to add JavaScript to your HTML, basic syntax, variables, data types, functions, and event handling. 1. Adding JavaScript to Your HTML You can add JavaScript directly into your HTML file. The simplest way is by using the <script> tag. <!DOCTYPE html> <html> <head>     <title>JavaScript Basics</title> </head> <body>     <h1>Hello, World!</h1>     <script>         alert("Welcome to JavaScript!");     </script> </body> </html> In this example, the alert() function will display a pop-up message saying "Welcome to JavaScript!" as soon as the page loads. This method is great for testing simple script...