HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
frame and table css inline code
Post new topic   Reply to topic    HTML Help Forum Index -> CSS
View previous topic :: View next topic  
Author Message
quartzy



Joined: 26 Dec 2007
Posts: 413

PostPosted: Wed Jan 30, 2008 8:26 am     frame and table css inline code Reply with quote

I have this coding for a comment box, and I want to style the height and margins with inline css. Can anyone tell me the correct coding? I have not learned how to code frames as never though I would need them.

Code:
<!-- BEGIN CBOX - www.cbox.ws -->
<div style="align:center;" id="cboxdiv">
<iframe width="112" height="305" src="http://www.cbox.ws/box/?boxid=1055082&amp;boxtag=x0v2c4&amp;sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#F4F4F4 1px solid;" id="cboxmain"></iframe><br/>
<iframe width="112" height="75" src="http://www.cbox.ws/box/?boxid=1055082&amp;boxtag=x0v2c4&amp;sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#F4F4F4 1px solid;" id="cboxform"></iframe>
</div>
<!-- END CBOX -->


I have started removing some of the wrong coding but am stuck on the iframes.
quartzy



Joined: 26 Dec 2007
Posts: 413

PostPosted: Wed Jan 30, 2008 8:28 am     re Reply with quote

the coding is wrong as it does not validate strict HTML, otherwise could anyone direct me to where I could find out more, I have tried but no joy.
madprof



Joined: 26 Jan 2008
Posts: 98

PostPosted: Wed Jan 30, 2008 12:33 pm     Reply with quote

Out of interest why inline CSS and not just in your stylesheet?
Maybe put a <div> around each iframe and style that to give you some margins if for some reason iframes don't accept them?

From what I read here http://www.cs.tut.fi/~jkorpela/html/iframe.html#margins it looks like there is no direct CSS replacement for marginwidth and marginheight (happy to be proved wrong!) and I'd definitely say styling the page you're putting in the iframe is better, but if you don't own it then just stick to using marginwidth and marginheight I guess.
quartzy



Joined: 26 Dec 2007
Posts: 413

PostPosted: Wed Jan 30, 2008 2:43 pm     re Reply with quote

Well I thought that as I will just have this one box and maybe another somewhere else, I though inline styling would at least validate. So you suggest putting each iframe in a div? I will try that and see if it works.
madprof



Joined: 26 Jan 2008
Posts: 98

PostPosted: Fri Feb 01, 2008 11:00 am     Reply with quote

Inline styling is generally a Bad Thing because it makes you chase around for your styles all the time.

It definitely makes no odds to validation and helps you separate style and HTML so both sets of code are easier to read.
quartzy



Joined: 26 Dec 2007
Posts: 413

PostPosted: Fri Feb 01, 2008 11:38 am     re Reply with quote

Hello, I have not got round to it yet, I just want it to validate, and the code they gave me is wrong, like the google box which I had to change too. So I will try and do it so it validates.
quartzy



Joined: 26 Dec 2007
Posts: 413

PostPosted: Sat Feb 02, 2008 2:48 am     re code Reply with quote

I have tried to validate this code but I cannot get it to work. If I put the sections in divs they all go wrong. Too wide space between form sections.If I put the iframe in their div id's it goes wrong,does not show properly, so I guess I will just have to do without, unless anyone can help me get this code right.
madprof



Joined: 26 Jan 2008
Posts: 98

PostPosted: Sat Feb 02, 2008 11:39 am     Reply with quote

Can you provide some sort of link? I'm not able to picture quite what is happening here. PM me on here if you don't want it public but I can probably help more if I can see what it is you're doing.
quartzy



Joined: 26 Dec 2007
Posts: 413

PostPosted: Sat Feb 02, 2008 12:35 pm     re Reply with quote

Well if you post the code into your browser and then save and try to validate it, HTML strict, it does not validate it.
My new site is now online without this box. www.bytesizeoffice.co.ukbut I really wanted the box on the homepage, on the left hand side underneath the navigation.
madprof



Joined: 26 Jan 2008
Posts: 98

PostPosted: Sat Feb 02, 2008 4:16 pm     Reply with quote

<iframe> is not allowed in strict HTML and this is what you're using on your page. Specify the transitional doctype and make sure is the full one i.e.:
Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">


and I think you'll be OK.

If you really really must use strict then you're stuck because you can't do what you want without an <iframe>.

<object> is supposed to replace <iframe> when using strict HTML but IE won't show a page within an <object> element when it's from a different domain.

So you need to make it show an intermediate page that is hosted on your website. This intermediate page contains an iframe pointing at the external site. But this won't work with the external site's controls that you're including here.

So go with transitional doctype - I spent ages looking into a way to do this with strict doctype and found it was not possible with your circumstances.

Just as a friendly note, please do mention which version of HTML you are trying to validate against when you have validation errors. Smile I only knew that this was the problem when I saw your site's doctype!
quartzy



Joined: 26 Dec 2007
Posts: 413

PostPosted: Sat Feb 02, 2008 4:54 pm     re Reply with quote

hello, thanks for explaining this to me, I did not realise iframe would not work with Strict doctype. By the way I did mention the doctype, look above, perhaps there are many versions of strict which I do not know. Now I have to go with transitional that will be OK for now. Do you know if XHTML validates with an iframe? as I can code that way maybe, but I doubt it will if strict HTMLK does not validate with iframe. Thanks for your help again. I am learning all the time.
madprof



Joined: 26 Jan 2008
Posts: 98

PostPosted: Sat Feb 02, 2008 5:04 pm     Reply with quote

Doh, yes you did. Sorry.

Anyway, yes iframe is fine with both XHTML and HTML, but only transitional.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> CSS All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial