Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

<marquee>This is basic example of marquee</marquee>

This will produce following result:

Online Practice:
To Become more comfortable - Do Online Practice

Attributes:
Attribute Value Description
scroll
behavior slid Defines the type of scrolling.
alternate
rgb(x,x,x)
bgcolor #xxxxxx Deprecated - Specifies the background color.
colorname
up
down
direction Defines the direction of scrolling the content.
left
right
height pixels or % Defines the height of marquee.
hspace pixels Specifies horizontal space around the marquee.
Specifies how many times to loop. The default value is
loop number
INFINITE, which means that the marquee loops endlessly.
scrolldelay seconds Defines how long to delay between each jump.
scrollamount number Defines how how far to jump.
width pixels or % Defines the width of marquee.
vspace pixels Specifies vertical space around the marquee.

Standard Attributes:
Attribute Description
class Document wide identifier
dir Specifies the direction of the text
id Document wide identifier
title Specifies a title to associate with the element.
style Helps to include inline casecadubf style sheet.
lang Sets the language code.
xml:lang Sets the language code.

Event Attributes:
Attribute Description
onclick Script runs when a mouse click
ondblclick Script runs when a mouse double-click
onmousedown Script runs when mouse button is pressed
onmouseup Script runs when mouse button is released
onmouseover Script runs when mouse pointer moves over an element
onmousemove Script runs when mouse pointer moves
onmouseout Script runs when mouse pointer moves out of an element
onkeypress Script runs when key is pressed and released
onkeydown Script runs when key is pressed
onkeyup Script runs when key is released

///////////////////////////////////////////

var html = "";


html += "<table class='colorful'>";
foreach(var item in collection) {
html += "<tr>";
html += "<td class='boldCell'>" + item.PropWhatever + "</td>";
// more cells here as needed
html += "</tr>";
}
html += "</table>";
placeholder1.InnerHtml = html;

/////////////////////////////////////////////////////////////////////////
using System;
using System.IO;
using System.Web.UI;

class Program
{
static string[] _words = { "Sam", "Dot", "Perls" };

static string GetDivElements()


{
// Initialize StringWriter instance.
StringWriter stringWriter = new StringWriter();

// Put HtmlTextWriter in using block because it needs to call


Dispose.
using (HtmlTextWriter writer = new HtmlTextWriter(stringWriter))
{
// Loop over some strings.
foreach (var word in _words)
{
// Some strings for the attributes.
string classValue = "ClassName";
string urlValue = "http://www.dotnetperls.com/";
string imageValue = "image.jpg";

// The important part:


writer.AddAttribute(HtmlTextWriterAttribute.Class,
classValue);
writer.RenderBeginTag(HtmlTextWriterTag.Div); // Begin #1

writer.AddAttribute(HtmlTextWriterAttribute.Href,
urlValue);
writer.RenderBeginTag(HtmlTextWriterTag.A); // Begin #2

writer.AddAttribute(HtmlTextWriterAttribute.Src,
imageValue);
writer.AddAttribute(HtmlTextWriterAttribute.Width, "60");
writer.AddAttribute(HtmlTextWriterAttribute.Height, "60");
writer.AddAttribute(HtmlTextWriterAttribute.Alt, "");

writer.RenderBeginTag(HtmlTextWriterTag.Img); // Begin #3
writer.RenderEndTag(); // End #3

writer.Write(word);

writer.RenderEndTag(); // End #2
writer.RenderEndTag(); // End #1
}
}
// Return the result.
return stringWriter.ToString();
}

You might also like