Mywebdunia's Blog

Archive for September 2009

Iframes allow you to load separate html files into an existing document. You can place iframes anywhere in the document and can use CSS and JavaScript to manipulate the properties of the iframe.

Example of iframe:

<iframe scrolling=”no” width=”500″ height=”300″ src=”iframe-sample.html” frameborder=”0″> </iframe>

Content of iframe-sample.html:
Say below is the content
<a href=”http://www.google.com&#8221; title=”Google” >Google</a>

The above example says the iframe will load a iframe-sample.html file withtin the specified width of 500px and height of 300px, ie,; you get google.com loaded within that specified width and height when you click on the link.

If you need the google.com page to be loaded into the same full page, then you need to add the target path to the anchor tag as parent, below is the code

<a href=”http://www.google.com&#8221; title=”Google” target=”_parent” >Google</a>

By writing _parent the page gets loaded into the parent of the iframe.

The iframe element is not valid in strict (X)HTML. Documents containing iframes will validate with transitional or frameset doctype declarations.

Some of the attributes supported by iframes are:

width: specifies the width of the iframe.

height: specifies the height of the iframe.

frameborder: specifies whether to display border or not (0,1) of the iframe.

name: specifies the name of an iframe.

scrolling: pecifies whether to display scrollbars or not.

marginheight: specifies top and bottom margins of the iframe.

marginwidth: specifies left and right margins of the iframe.

src: specifies the url of the document that to be loaded.

title: specifies the title of the iframe.

class: specifies the classname for an element.

id: specifies the id (unique id) for an element.

style: specifies inline style for an element.

Tags: ,

As we all know aligning header at the top is as easy as saying it. Always the first div tag or a table td tag will appear at the top, so no question of aligning the header at the top. But how about aligning footer at the bottom always even when seen under different resolutions. Yes even that is easy. Follow these steps and make it working for you guys.

Here is how you can do it, check for the HTML/CSS code.

HTML Code:

<div id=”wrapper”>
<div id=”header”>
Some heading goes here…
</div>
<div id=”content”>
<p>Some Description goes here…</p>
<p>Some Description goes here…</p>
<p>Some Description goes here…</p>
<p>Some Description goes here…</p>
<p>Some Description goes here…</p>
</div>
</div>
<div id=”footer”>
Copyright content goes here
</div>

CSS Code:

<style type=”text/css” >
*{
margin:0;
padding:0;
}
html, body{
height:100%;
}

#wrapper{
border:0 none;
margin:0 auto;
min-height:100%;
width:900px;
}
#header{
border:1px solid #c0c0c0;
height:50px;
width:900px;
text-align:center;
background-color:#CCCCC2;
}
#content{
padding:10px;
width:880px;
border:1px solid #c0c0c0;
}
#footer{
background-color:#CCCCC2;
border:0 none;
height:35px;
margin:-45px auto 0;
padding:10px 0 0;
text-align:center;
width:900px;
}
</style>

Try this if you did not get it, let me know will work out for it.

Whenever you are linking a document or an image in a web page, either you need to have an absolute path or its relative path to link it. Lets see about these two paths in detail.

1. Absolute Path Url:
Absolute path is one which has the full url including the domain name, for example the absolute path to this web page is https://mywebdunia.wordpress.com/2009/09/09/absolute-and-relative-paths/

2. Relative Path Url:
Relative path are those which does not contain the domain name that is it does not starts with http. For example this could be one

<img src=”images/title.gif”>
Here as you can see there is no domain name included into the src .

Relative are much more frequently used than absolute paths.


Categories