Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > CSS > CSS Cascading Style Sheets
|
CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 20th, 2005, 07:31 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to use css with <iframe frameBorder="no">

Hello
I am tired of coding
'<iframe src="name.htm" marginWidth="0" marginHeight="0" frameBorder="no" scrolling="no"></iframe>' to each <iframe>

Can I do with <style> tag on css so I don't have to hard code it in?
I tried to look for the answer on web but I haven't found any.

Thanks

 
Old January 20th, 2005, 08:57 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

CSS provides a control for this. The one it does provide, Internet Explorer doesn't support.

For the border, the border property should apply. However, IE treats the frameborder as a separate border from the CSS border, all other browsers treat it as the same border.

One would think that the margin, padding or even border-spacing properties would apply in place of marginwidth and marginheight attributes, but none of these allow control over that space for inline frames.

The ideal thing to do is avoid using frames. Frames are generally frowned upon by the W3C because they impede a page's accessibility, I suspect this is why there has been little done to make <iframe> completely controlable via CSS.

If going this route, what can be put in an <iframe> can be put directly into a document e.g. between <div> tags, and the behavior of an <iframe> simulated with the CSS "overflow" property (supported in all the major browsers that matter, IE 5.5, IE 6, Gecko and KHTML). In fact this method provides much more control, than <iframe> does. Of course this only works if you have control over what's being put in the <iframe>.

Sorry I couldn't bring better news!

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274) epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:37 AM
<table> not displaying because of <iframe> crmpicco HTML Code Clinic 16 October 6th, 2007 04:46 PM
About CSS Chapter 5 the <thing> + <thing> {} part thenetduck BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 0 February 7th, 2007 03:45 AM
set the frameborder of an iframe to zero in CSS crmpicco CSS Cascading Style Sheets 3 April 12th, 2006 03:04 AM
<iframe> problem cutesneakers PHP How-To 3 December 29th, 2004 02:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.