| View previous topic :: View next topic |
| Author |
Message |
quartzy
Joined: 26 Dec 2007 Posts: 413
|
Posted: Wed Jan 30, 2008 8:26 am frame and table css inline code |
|
|
|
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&boxtag=x0v2c4&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&boxtag=x0v2c4&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
|
Posted: Wed Jan 30, 2008 8:28 am re |
|
|
|
| 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
|
Posted: Wed Jan 30, 2008 12:33 pm |
|
|
|
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
|
Posted: Wed Jan 30, 2008 2:43 pm re |
|
|
|
| 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
|
Posted: Fri Feb 01, 2008 11:00 am |
|
|
|
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
|
Posted: Fri Feb 01, 2008 11:38 am re |
|
|
|
| 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
|
Posted: Sat Feb 02, 2008 2:48 am re code |
|
|
|
| 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
|
Posted: Sat Feb 02, 2008 11:39 am |
|
|
|
| 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
|
Posted: Sat Feb 02, 2008 12:35 pm re |
|
|
|
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
|
Posted: Sat Feb 02, 2008 4:16 pm |
|
|
|
<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. I only knew that this was the problem when I saw your site's doctype! |
|
quartzy
Joined: 26 Dec 2007 Posts: 413
|
Posted: Sat Feb 02, 2008 4:54 pm re |
|
|
|
| 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
|
Posted: Sat Feb 02, 2008 5:04 pm |
|
|
|
Doh, yes you did. Sorry.
Anyway, yes iframe is fine with both XHTML and HTML, but only transitional. |
|
|