0

Posted by Michael Alfaro on January 27, 2012

Iframing a portion of a webpage to exclude unwanted navs, and sidebar callouts

This code was shared by a great client of ours, Kevin Ormsby (Web Developer) over at ELS. Wanted to reshare with the world as I’m sure there’s a need for this if we found a need for it.

It will allow you to give the top left coordinates that you’d like the iframe to begin with.  And you could eliminate items from the right and bottom by adjusting the over width and height of the iframe itself, thus you can get a perfect iframe until the page you’re pointing to changes :)

Thanks Kevin!

<style type=”text/css”>
#contact{
width:700px;
height:700px;
overflow:hidden;
}

#contact iframe {
margin-left:-15px;
margin-top:-255px;
border:0;
}
</style>

<div id=”contact”>
<iframe src=”http://www.els.edu/ContactUs” scrolling=”no” width=”600″ height=”840″></iframe>
</div>

Topics: , , ,

Add a Comment