HTML DOM Ins Object

Ins Object The Ins object represents an HTML <ins> element. Access an Ins Object You can access an <ins> element by using getElementById(): Example var x = document.getElementById(“myIns”); Try it Yourself » Create an Ins Object You can create an <ins> element by using the document.createElement() method: Example var x = document.createElement(“INS”); Try it Yourself » Ins […]

HTML srclang Attribute

Example A video with two subtitle tracks: <video width=”320″ height=”240″ controls> <source src=”forrest.mp4″ type=”video/mp4″>  <track src=”subtitles_en.vtt” kind=”subtitles” srclang=”en” label=”English”> <track src=”subtitles_no.vtt” kind=”subtitles” srclang=”no” label=”Norwegian”> </video> Definition and Usage The srclang attribute specifies the language of the track text data. This attribute is required if kind=”subtitles”. Tip: To view all available language codes, go to our Language code reference. Browser Support The numbers in the table specify the first browser version […]

HTML <embed> src Attribute

Example An embedded flash animation: <embed src=”helloworld.swf”> Try it Yourself » Definition and Usage The src attribute specifies the address of the external file to embed. Browser Support Attribute src Yes Yes Yes Yes Yes Differences Between HTML 4.01 and HTML5 The <embed> tag is new in HTML5. Syntax <embed src=”URL“> Attribute Values Value Description URL […]

HTML <embed> height Attribute

Example A flash animation with a height and width of 200 pixels: <embed src=”helloworld.swf” width=”200″ height=”200″> Try it Yourself » Definition and Usage The height attribute specifies the height of the embedded content, in pixels. Tip: Use the width attribute to specify the width of the embedded content. Browser Support Attribute height Yes Yes Yes Yes Yes Differences Between HTML 4.01 […]

HTML <colgroup> width Attribute

Example A <colgroup> element that specifies that the first column should have a predefined width of 200 pixels: <table> <colgroup width=”200″> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The width attribute specifies the width of a column group. Normally, a column group takes […]

HTML <col> width Attribute

Example Two <col> elements with a predefined width: <table> <col width=”130″> <col width=”80″> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself » Definition and Usage The width attribute specifies the width of a <col> element. Normally, a <col> element takes up the space it needs to display the content. […]

HTML <canvas> Tag

Example Draw a red square, on the fly, and show it inside the <canvas> element: <canvas id=”myCanvas”></canvas> <script> var canvas = document.getElementById(“myCanvas”); var ctx = canvas.getContext(“2d”); ctx.fillStyle = “#FF0000”; ctx.fillRect(0, 0, 80, 80); </script> Try it Yourself » Definition and Usage The <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript). The <canvas> tag is only a container […]

HTML <a> type Attribute

Example The type attribute specifies the media type of the linked document: <a href=”https://dwfaisalabad.com” type=”text/html”>dwfaisalabad</a> Try it Yourself » Definition and Usage The type attribute specifies the Internet media type (formerly known as MIME type) of the linked document. This attribute is only used if the href attribute is set. Note: This attribute is purely advisory. Differences Between […]

HTML Images

Images can improve the design and the appearance of a web page. HTML Images Syntax In HTML, images are defined with the <img> tag. The <img> tag is empty, it contains attributes only, and does not have a closing tag. The src attribute specifies the URL (web address) of the image: <img src=”url“> The alt Attribute The alt attribute provides an alternate text for an […]

HTML Iframes

An iframe is used to display a web page within a web page. Iframe Syntax An HTML iframe is defined with the <iframe> tag: <iframe src=”URL“></iframe> The src attribute specifies the URL (web address) of the inline frame page. Iframe – Explaination Use the height and width attributes to specify the size of the iframe. The attribute values are specified in pixels by default, […]

HTML Styles – CSS

Styling HTML with CSS CSS stands for Cascading Style Sheets. CSS describes how HTML elements are to be displayed on screen, paper, or in other media. CSS saves a lot of work. It can control the layout of multiple web pages all at once. CSS can be added to HTML elements in 3 ways: Inline – by using the style attribute in […]

HTML Basic Examples

Don’t worry if these examples use tags you have not learned. You will learn about them in the next chapters. HTML Documents All HTML documents must start with a document type declaration: <!DOCTYPE html>. The HTML document itself begins with <html> and ends with </html>. The visible part of the HTML document is between <body> and </body>. Example <!DOCTYPE html> <html> <body> <h1>My […]

HTML Introduction

What is HTML? HTML is the standard markup language for creating Web pages. HTML stands for Hyper Text Markup Language HTML describes the structure of Web pages using markup HTML elements are the building blocks of HTML pages HTML elements are represented by tags HTML tags label pieces of content such as “heading”, “paragraph”, “table”, […]