Found 2416 Articles for HTML

Including CSS in HTML Documents

AmitDiwan
Updated on 21-Dec-2023 16:56:45

110 Views

Adding CSS to an HTML document enhances the appearance of the web page. Various styles for the images, borders, margins, colors, can be easily added. To include CSS in HTML documents, we can either include them internally, inline or link an external file. Let us understand them with examples. Syntax The syntax for including CSS files in HTML is as follows − /*inline*/ /*internal*/ /*declarations*/ /*external*/ The following examples shows the linking of CSS file ... Read More

How elements float in HTML?

AmitDiwan
Updated on 15-Nov-2023 13:46:56

299 Views

We can float elements with CSS float property to either the left or right of the containing parent element. Other elements are placed around the floated content. Multiple elements with same value of float property enabled are all placed adjacently. Float Left In this example, the image is placed on the left using the float property with the value left. To set the right margins properly, we have set it using the margin-right property − img { float: left; margin-right:20px; } Example Let us see an example to float elements to the left − ... Read More

HTML DOM writeln() Method

AmitDiwan
Updated on 15-Feb-2021 04:30:20

157 Views

The HTML DOM writeln() provides user the functionality to write multiple expressions (HTML or JavaScript) directly to a document.NOTE − This method overwrites HTML code in a document if any and does appends arguments to a new line.SyntaxFollowing is the syntax −document.write(agruments)ExampleLet us see an example of HTML DOM document writeln() method − Live Demo HTML DOM writeln()    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       ... Read More

HTML DOM write() Method

AmitDiwan
Updated on 15-Feb-2021 04:33:03

217 Views

The HTML DOM write() provides user the functionality to write multiple expressions (HTML or JavaScript) directly to a document.NOTE − This method overwrites HTML code in a document, if any and does not appends arguments to a new line.SyntaxFollowing is the syntax −document.write(arguments)ExampleLet us see an example of HTML DOM document write() method − Live Demo HTML DOM write()    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {     ... Read More

HTML DOM Window stop() Method

AmitDiwan
Updated on 15-Feb-2021 04:37:58

179 Views

The HTML DOM Window stop() provides user the functionality to stop loading the resources of a window without clicking the browser stop button.SyntaxFollowing is the syntax −window.stop()ExampleLet us see an example of HTML DOM Window stop() method − HTML DOM Window stop()    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;                   ... Read More

HTML DOM Window parent Property

AmitDiwan
Updated on 21-Dec-2021 07:51:23

663 Views

The HTML DOM Window parent property returns a reference to the parent window of the child window.SyntaxFollowing is the syntax −Returning reference of parent windowwindow.parentExampleLet us see an example of HTML DOM Window parent property − HTML DOM Window parent    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;                    HTML-DOM-Window-parent   ... Read More

HTML DOM Window opener Property

AmitDiwan
Updated on 21-Dec-2021 07:54:23

506 Views

The HTML DOM Window opener property returns a reference to the parent window that launched/created the child window using open().SyntaxFollowing is the syntax −Returning reference of parent windowwindow.openerExampleLet us see an example of HTML DOM Window opener property − HTML DOM Window opener    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;                 ... Read More

HTML DOM localStorage Properties

AmitDiwan
Updated on 15-Feb-2021 04:38:59

162 Views

The HTML DOM localStorage Properties enables user to store key-value pairs in local browser itself for future reference. Key-value pairs are not lost until explicitly removed/cleared.SyntaxFollowing is the syntax −Window.localStorageHere, localStorage can have following properties/methods −setItem(‘key’, ’value’)getItem(‘key’)removeItem(‘key’)Let us see an example of localStorage properties −Example Live Demo LocalStorage clear()    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    }    table, th, td { ... Read More

HTML DOM Window frames Property

AmitDiwan
Updated on 21-Dec-2021 07:57:17

154 Views

The HTML DOM Window frames property returns an object corresponding to the window, representing all frames present in it.SyntaxFollowing is the syntax −Returning frames in current windowwindow.framesLet us see an example of HTML DOM Window frames property −Example HTML DOM Window frames    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;                    HTML-DOM-Window-frames   ... Read More

HTML DOM Window frameElement Property

AmitDiwan
Updated on 21-Dec-2021 08:01:37

197 Views

The HTML DOM Window frameElement property returns a HTML element corresponding to the window in which it is embedded such as , , or .SyntaxFollowing is the syntax −Returning window embedding elementwindow.frameElementExampleLet us see an example of HTML DOM Window frameElement property − HTML DOM Window frameElement    * {       padding: 2px;       margin:5px;    }    form {       width:70%;       margin: 0 auto;       text-align: center;    }    input[type="button"] {       border-radius: 10px;           ... Read More

Advertisements