SandySynaptik Posted October 19, 2011 Share Posted October 19, 2011 I have an iframe, I want it appear in full window (height and width) whatever is the user's resolution but want to prevent it from making any scrollbars. Link to comment Share on other sites More sharing options...
eTianbun Posted October 19, 2011 Share Posted October 19, 2011 Use percentage (%) in the height and width of the iframe, then use scroling="no" to prevent scrollbar. Link to comment Share on other sites More sharing options...
Ingolme Posted October 19, 2011 Share Posted October 19, 2011 You want an iframe to just take up the whole window? Are you trying to display somebody else's website?You could make a frameset instead: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"><html><frameset cols="100%"> <frame src="URL" frameborder="0" scrolling="no"></frameset></html> If you really think you need an iframe, make sure that you use CSS to reset margins and padding, and give the <html>, <body> and <iframe> element 100% width and height: html,body { margin: 0; padding: 0; width: 100%; height: 100%;}iframe { width: 100%; height: 100%;} In the iframe code, set the frameborder and scrolling attributes: <iframe src="URL" frameborder="0" scrolling="no"> Link to comment Share on other sites More sharing options...
SandySynaptik Posted October 20, 2011 Author Share Posted October 20, 2011 The idea is right, but I can still see the vertical scrollbar.http://synaptik.co.cc/example Link to comment Share on other sites More sharing options...
Ingolme Posted October 20, 2011 Share Posted October 20, 2011 The scrollbar isn't inside the iframe, it's outside.Since the <iframe> is inline (iframe standa for inline frame) it has a tiny space below it for text. You can set the display property to "block". Link to comment Share on other sites More sharing options...
SandySynaptik Posted October 22, 2011 Author Share Posted October 22, 2011 I was carrying an experiment and again this issue came upThis time I'm fighting with DIVs instead of iframe : http://synaptik.co.cc/random/color/generator Link to comment Share on other sites More sharing options...
Ingolme Posted October 22, 2011 Share Posted October 22, 2011 You have to reset the margin and padding on the html and body elements: html, body { margin: 0; padding: 0;} Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.