Category Archives: html

pdf embed on html without using flash





I was looking for ways to embed pdf file on html without using flash. There are many ways of doing it, other suggested of using www.scribd.com but the prob is it would be hosted in their server. Then I found this solution using the google viewer which you only need to supply the url and also another good thing is it doesn’t require flash :)

<iframe src="http://docs.google.com/gview?url=http://example.com/mypdf.pdf&embedded=true" style="width:718px; height:700px;" frameborder="0"></iframe> 

 

css: display vs visibility

Tip: Even invisible elements takes up space on the page. Use the “display” property to create invisible elements that do not take up space.

Definition

The visibility property sets if an element should be visible or invisible.

Inherited: No

Tip: Even invisible elements takes up space on the page. Use the “display” property to create invisible elements that do not take up space.


JavaScript Syntax

CSS properties can also be dynamically changed with a JavaScript.

Scripting Syntax: object.style.visibility=”hidden”

In our HTML DOM tutorial you can find more details about the visibility property.

In our HTML DOM tutorial you can also find a full Style Object Reference.


Example

p
{
visibility: hidden
}

Possible Values

Value Description
visible The element is visible
hidden The element is invisible
collapse When used in table elements, this value removes a row or column, but it does not affect the table layout. The space taken up by the row or column will be available for other content. If this value is used on other elements, it renders as “hidden”

source:http://www.w3schools.com/CSS/pr_class_visibility.asp





align center not working on ie

Last time I was having problem aligning my website at the center when viewing on ie browser ONLY. I’ve used margin-left:auto and margi-right:auto but it didn’t work but how come on my other websites it worked!

I found the culprit it’s my doctype coz on that website which I cannot center I’m using html 4 whereas on my other websites i’m using  xhtml1.  Actually that’s not the only issue coz on my previous post I also have problem on css hover on non-anchor tag, like applying hover on a <tr> and likewise this doctype saves the day.  There are still other issues like opacity…

Anyway, these issues only happened on ie browser but not on firefox and safari.

Check the sample below:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>

nofollow links

I just heard about this new attribute added on links but really don’t have any idea about it. Thanks goodness to Dave Taylor that explains what is nofollow and it’s advantage on SEO.

By adding this attribute rel on your anchor/link,  search engine will ignore the linked site w/c gains page rank from the source site.

It’s done like this:
<a href=”some URL rel=”nofollow”>text that’s linked</a>

You can read more about it here: http://www.askdavetaylor.com/google_yahoo_and_msn_support_nofollow_whats_that.html