Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Thursday, 25 May 2017

MARQUEE Element in HTML

The <marquee> tag is used for scroll the text or image displayed either horizontally across or vertically down your web page depending on the settings. <marquee> is container tag or element.

Syntax:
               <marquee> text/ image</marquee>

Attribute of <marquee> Tag:



behavior:  
                    Set the behavior of the marquee.
Possible values are scroll, slide and alternate. If no value is specified, the default value is scroll.

bgcolor: set the background color or the marquee tag.

direction: Sets the direction of scrolling within the marquee.

height: Sets the height in pixels or percentage.

hspace: Sets the horizontal margin.

loop: Sets the number of times the marquee will scroll. if no value is specified, the default value is -1, which means the marquee will scroll continuously.

scrollamount: Sets the amount of scrolling at each interval in pixels. default value is 6.

scrolldelay: Sets the interval between each scroll movement in milliseconds. the default value is 85. Note that any value smaller than 60 is ignored and the value 60 is used instead unless truespeed is specified.









truespeed: By default, scrolldelay values lower than 60 are ignored. if truespeed is present, those values are not ignored.

vspace: Sets the vertical margin in pixels or percentage value.

width: Sets the width in pixels or percentage value.

For Example:
 HTML file Name:marquee.html

<!DOCTYPE html>
<html>
<head>
<title>HTML marquee Tag</title>
</head>
<body>
<marquee>Example of marquee</marquee>
<marquee direction="up">The direction of text will be from bottom to top.</marquee>
<marquee>This text will scroll from right to left</marquee>

<marquee direction="up">This text will scroll from bottom to top</marquee>

<marquee direction="down" width="550" height="200" behavior="alternate" style="border:solid blue;background-color:green">
<img src="image.jpg" width20 height=30>
  <marquee behavior="alternate">
    This text will bounce
  </marquee>
</marquee>
</body>
</html>

  
Browser View of Above document:

 
 







Saturday, 29 April 2017

XML Tree structure

The tree structure is often referred to as XML Tree and plays an important role in describing any XML document.
the tree structure contains root (parent) elements, child elements and so on. by using tree structure, you can get to know all succeeding branches and sub-branches starting from the root.


For Example:
<?xml version="1.0"?>
<contact-info>
<address category="residence">
<name>kumar shivan</name>
<company>HCL pvt ltd</company>
<phone>(001)123-4567</phone>
<address/>
</contact-info>
 In this example The <contact-info> is the root element and child element are its branches.

Wednesday, 26 April 2017

XML Language Elements

XML can be defined as building blocks of an XML document. Elements can behave as containers to hold text, elements, attributes, media objects or all of these. Each XML document contains one or more elements. An XML element is everything delimited by start and end tags which means it is everything within the including the tags themselves. Start and end tags of an element must be identical.

Syntax:

<element-name attributel attribute2>
.................content
</element-name>
Where :
  • element-name is the name of the element. The start and end tags must be of the same case.
  • attribute1,attribute2 are attributes of the element separated by white spaces.
  • An attribute defines a property of the element. It associates a name with a value, which is a string of characters.
An Attribute is written as-
name="value"

Name is followed by an = sign and a string value inside double(" ") or single(' ') Quotes.

Attributes given more information about XML elements. To be more precise they define properties of elements. An XML attribute is always a name-value pair as can be seen in the above example.

Rules for XML elements naming:
  • An element name can contain any alphabet, number and characters.
  • Element names must start with a letter or underscore.
  • Special characters allowed in names are the hyphen (-), under-score(_) and period (.).
  • Names are case sensitive. For example, Term, term and TERM are different names.
  • The name cannot contain blank spaces.
  • Names cannot start with xml(Xml or XML which is a reserved word)
For  Exmple:

<element>...</element>

Example of an XML document using various XML elements.

<?xml version="1.0"?>
<contact-info>
<address category="residence">
<name>kumar shivan</name>
<company>HCL pvt ltd</company>
<phone>(001)123-4567</phone>
<address/>
</contact-info>

Tuesday, 11 April 2017

Frames name and target attributes

The most popular uses of frames is to place navigation bars (links) in one frame and then load main pages into a separate central frame. this is done using the name attribute of the <frame> tag and the target attribute of the <a> tag.
For example :
where a target.html has following code:

<html>
<head>
<title>HTML target frame</title>
</head>
<frameset cols="150,*">
<frame src="menu.html" name="menu_page">
<frame src="main.html" name="main_page">
</frameset>
</html>

In this example we have create two frames. the first frame is 150 pixels wide and will contain the menubar implemented by menu.html file. the second column fills in remaining space. It will contain the main part of the page and it is implemented by main.html file. for both the links available in the menubar, we have mentioned the target frame as main_page. so whenever you click any of the links in menubar the link will open in main_page.

menu.html
<html>
<head>
<title>MENU html file
</title></head>
<body bgcolor="green">
<H3>Menu
</H3>
<br>
<a href="http://www.careersoft-tech.blogspot.com" target="main_page">careersoft</a>
<br>
<a href="http://www.dotprogramming.blogsport.com" target="main_page">dotprogramming</a>
<br>
</body>
</html>

The HTML code of the main.html file:

<html>
<head>
<title>main html file</title>
</head>
<body bgcolor="pink">
<H3>This is the main page of the Website</H3>
</h3>Content for the link will be displayed here:</h3>
</p>Click on a link in the menu
</p>
</body>
</html>
The Browser View :


Click on any link in the Menu to see the webpage in the main frame.



Attributes of frameset and frame Tag

The attributes of frameset tag are:-

cols: 
        This specifies how many columns are contained in the frameset and the size of each column. You can specify the width of each column in one of four ways:


  • Absolute values in pixels. for example to create three vertical frames, use cols="100,500,100".
  • A percentage of the browser window .eg: cols="20%,60%,20%".
  • Using a wildcard symbol. eg: cols="10%,*,10%".
  • As relative widths of the browser window. eg: cols="3*,2*,1*"


rows:
         This attribute works just like the cols attribute and takes the same values, but it is used to specify the rows in the frameset.

Attributes of the <frame> Tag:

src: 
       This attribute is used to give the name that should be loaded in the frame. Its value cane be any URL.

name:
            This attribute allows you to give a name to aframe. It is used to indicate which frame a document should be loaded into.

frameborder:
                     this is specify if there are border in the frame,it override the value given in the frameborder attribute on the <fremeset> tag if given. this can take values either 1(for borders) or 0 (no border).

marginwidth:
                     Specify the width of the space between the left and right frame borders and content in it.
                 eg: marginwidth="10"

marginheight:
                      Specify the space between the top and bottom of the frame borders and its contents.
            eg: marginheight="10"

noresize:
               by default you can resize any frame by clicking and dragging on the borders of a frame.

scrolling:
               this attribute controls the appearance of the scrollbars on the frame. this takes values either "yes", "no" or "auto'.
eg: scrolling="no" means it should not have scroll bars. Default is auto.

       

Nested Frames in HTML

Example 1:To create nested frames which include both horizontal and vertical frames.


<html>
<head>
<title>frameset</title>
</head>
<frameset rows="30%,70%*">
<frameset cols="50%,50%">
<frame src="frame1.html">
<frame src="frame2.html">
</frameset>
<frame src="main.html">
</frameset>
</html>

The browser view of above example


The first row has been divided into two frames.

Example 2: In this example we will do the reverse. the second row will be divided into two frame.

<html>
<head>
<title>frameset</title>
</head>
<frameset rows="30%,70%*">
<frame src="frame1.html">
<frameset cols="40%,60%">
<frame src="frame2.html">
<frame src="main.html">
</frameset>
</frameset>
</html>

The browser view of above example





Simple Example of Frameset

Example 1: To have horizontal frames, We must use the rows attribute:

<html>
<head>
<title>frameset</title>
</head>
<frameset rows="10%,80%,10%">
<frame src="frame1.html">
<frame src="main.html">
<frame src="frame2.html">
</frameset>
</html>
In this example we have create three horizontal frames. the size of the top and  bottom one is 10% each and the middle one covers 80% of the screen.
the browser view of above example:


Example 2: To create only two frames.

<html>
<head>
<title>frameset</title>
</head>
<frameset rows="20%,*">
<frame src="frame1.html">
<frame src="main.html">
</frameset>
</html>

the browser view of above example:

In this example the screen has been divided into two frames. the top frame is covering 20% of the screen and the bottom one covers the remaining 80 percent, even though we have not specified the size. we have used a wildcard * here which will take up the remaining space from 100%. 

Example 3:We can specify the size in pixels instead of percentage.

<html>
<head>
<title>frameset</title>
</head>
<frameset cols="160,*">
<frame src="frame1.html">
<frame src="main.html">
</frameset>
</html>

the browser view of above example:


In this Example we have specify the size of frame in pixels. the first frame on the left has a size of 160 pixels. second fram covers the remaining portion of the screen as we have used the *.