linux1880 Posted June 17, 2010 Share Posted June 17, 2010 Hi friends, I need html iframe but without external source. I have a div which is very large to fit in page, I just want to give a iframe to certain height so that visitors can scroll down. Thanks Quote Link to comment Share on other sites More sharing options...
joePHP Posted June 18, 2010 Share Posted June 18, 2010 Hi, If I understood your question correctly, then you don’t need to use an iframe. Use your div and set it’s width and height to whatever you want (even if it’s smaller than what it contains. Then set it’s overflow to scroll and you will get scroll bars just like and iframe. For example: <div style="width: 100px; height: 100px; overflow: scroll;"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras quis nibh nec libero malesuada convallis vel at mauris. Nunc cursus ultricies pharetra. Aenean nisi elit, consectetur eu venenatis a, vulputate sit amet quam. Duis congue quam non lectus varius consequat. Nulla sollicitudin vehicula mi quis pretium. Donec vel magna eros. Curabitur et dolor mi, id aliquet orci. Fusce convallis bibendum sapien ultricies cursus. Suspendisse vehicula massa vel diam tempus et tempus lacus tincidunt. Nam vestibulum dapibus velit, ac tempus augue aliquam eu. Maecenas vel sem non metus mattis iaculis ac et lectus. Aliquam erat volutpat. Sed turpis dui, ultricies eget varius sodales, suscipit sit amet sapien. Maecenas tristique, odio nec tincidunt congue, neque nisl tincidunt neque, at ultricies quam odio quis est. Curabitur vel lobortis erat. </p> </div> Of course you should put the styles in an external file. I hope this helps, Joe Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.