Skip to main content

Posts

Showing posts with the label div

What is CSS Class ?

In CSS, classes allow you to apply a style to a given class of an element. To do this, you link the element to the style by declaring a style for the class, then assigning that class to the element. CSS Class Syntax You declare a CSS class by using a dot (.) followed by the class name. You make up the class name yourself. After the class name you simply enter the properties/values that you want to assign to your class. .class-name { property:value; } If you want to use the same class name for multiple elements, but each with a different style, you can prefix the dot with the HTML element name. html-element-name.class-name { property:value; } You can also select elements (or classes) that's nested within another element or class. For example, div.css-section p will select all elements that are nested within a <div> element that uses the .css-section class. One major benefit of doing this is that you don't need to apply a class to every instance of an ele...

Different element with different background in CSS

The example explains how we can color different element with different backgrounds. <head> <style> h1 { background-color: #6395ed; } p { background-color: #e000ff; } div { background-color: #b000de; } </style> </head> <body> I'am colored <div> This is a colored div. This is a colored para We are still in the div element. </div> </body> </html>

Special Effects in HTML - Marquee

If you want your text to move with in the screen, use the tag   <marquee> .  The text in between the tags will move horizontally. <marquee bgcolor=pink> will give background color to marquee texts.   <marquee bgcolor=orange width=100 height=20> will set height and width for marquee text. <marquee bgcolor="orange" direction="right" height="20" width="100"> will set   direction to marquee text. <html> <body> This is a scrolling text This is a scrolling text with background color This is a scrolling text This is a scrolling text This is a scrolling text </body> </html> Copy and download the code and try your self.

Using Html Styles And Colors

Using html Styles and Colors : This post will help you to understand the use of div element and using styles and color elements perfectly. Copy the code and try... <html> <body> HTML STYLES AND COLORS Text with space Spannable Text </body> </html>

HTM Tag - Structure

<html>.....</html> The <html> tag tells the browser that this is an HTML document.It represents the root of an HTML document.This tag is the container for all other HTML elements. <head>.....</head> The <head> tag is a container for all the head elements.The <head> element must include a title for the document, and can include scripts, styles, meta information, and more. <body>.....</body> The <body> tag defines the document's body.The <body> element contains all the contents of an HTML document, such as text, hyperlinks, images, tables, lists, etc. <div>.....</div> The <div> tag defines a division or a section in an HTML document.The <div> tag is used to group block-elements to format them with CSS. <span>.....</span> The <span> tag is used to group inline-elements in a document.They provides a way to add a hook to a part of a text or a part of a document. <html...