Jump to content

Help me with html iframe


linux1880

Recommended Posts

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.