Click to See Complete Forum and Search --> : Iframe used in CSS
robzdesigns
10-17-2004, 09:36 PM
Hey Wasup,
I'm just getting a feel for CSS and I was wondering can a Iframe be used with CSS? If so do you recommended it be used? And do you now how to implement it on the website?
Thanks Much!
pawky
10-17-2004, 11:28 PM
Originally posted by robzdesigns
Hey Wasup,
I'm just getting a feel for CSS and I was wondering can a Iframe be used with CSS? If so do you recommended it be used? And do you now how to implement it on the website?
Thanks Much!
Can it be? Yes
Should it be? No
iframes arent necessary. If you want the same effect basically just use a <div> with overflow: auto; If you need more help with this, let us know and we'll be glad to help.
robzdesigns
10-18-2004, 07:09 AM
Thanks for the reply, so your saying I can get the same effect of a iframe using a <div> with overflow: auto; ?
How does it work? and Yes, I do need more help and will appreciate your help!
sharkey
10-18-2004, 08:47 AM
It will give the same look as an iframe but not the same actions you cannot get pages to load up into the divs such as what the iframe does, but you can serve the content to change from page to page.
robzdesigns
10-18-2004, 10:08 AM
Now I'm starting to understand, but some people don't recommend using iframe. Is there a code for scrollable div's?
NogDog
10-18-2004, 10:47 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>
<title>Scrollable DIV</title>
<style type="text/css">
div.scroll {
width: 200px;
height: 300px;
overflow: auto;
margin: 0;
padding: 1em;
background-color: silver;
color: black;
}
</style>
</head>
<body>
<h1>Lorem Ipsum</h1>
<div class=scroll>
<h2>Lorem ipsum dolor</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum<./p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum<./p>
<h2>Lorem ipsum dolor</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum<./p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum<./p>
</div>
</body>
</html>
pawky
10-18-2004, 03:20 PM
Originally posted by robzdesigns
Now I'm starting to understand, but some people don't recommend using iframe. Is there a code for scrollable div's?
the code for the scrollable divs is : <div style="width:#px; height:#px; overflow: auto;">content</div>
u'd want to put the css externally though ;)
also, as sharkey said, you wont be able to link specific content to load in it by itself, but this is unneccesary anyways. You can also do some stuff to help with it using a server-side language i believe, though i dont know one yet so still have to learn about all that soon :P
also, so you know why iframes are frowned apon instead of just that they are ill give you a reason or two. First off, iframes break the ability for the use to use the bookmark feature efficiently as it was intended. Next, iframes are bad for SEO (seach engine optimization).
robzdesigns
10-19-2004, 07:08 AM
pawky thanks for clearing that up, now from reading of all of the reply's I understand the reason why iframes should be junked! especially for the SEO reason. I might consider using a scrollable div with the code provided above. Thanks:D
pawky
10-19-2004, 11:50 PM
awesome :D glad to be of assistance. and if you need any help getting a scrollable div to work let us know :)