|
-
Aug 8th, 2005, 10:33 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Iframes
for an Iframe do i still need to put the <noframes> tag or is that only with regular framesets...also how can i get the backround of my frame to be different from the background of the other areas or become transparent to completely show the main pages background?
-
Aug 9th, 2005, 01:41 AM
#2
Re: Iframes
<noframes> is for framesets. IFrame is something different from frames, so the answer to your question is, no, you don't need <noframes>
You can 'set' a background to an iframe by loading an html page in it which contains the background you want.
-
Aug 9th, 2005, 01:58 AM
#3
Thread Starter
Hyperactive Member
Re: Iframes
can i do it through css though? i wanna keep all my styles on 1 place for easy editing
-
Aug 9th, 2005, 02:03 PM
#4
Re: Iframes
Do you have an external style sheet? That is ALWAYS what I use. It allows you to get the most functionality out of CSS.
-
Aug 9th, 2005, 02:28 PM
#5
Thread Starter
Hyperactive Member
Re: Iframes
yes i do and its posted on my other forum u helped me out with
-
Aug 9th, 2005, 03:50 PM
#6
Re: Iframes
Then why not just link the page that the iFrame points to, to that CSS document:
HTML Code:
<iframe src="blah.html">
HTML Code:
<!-- inside blah.html -->
<link href="MyStyles.css" rel="StyleSheet" type="text/css">
That is how you get the iFrame to have the styles you want.
-
Aug 9th, 2005, 06:22 PM
#7
Thread Starter
Hyperactive Member
Re: Iframes
i dun really understand where i put this... do i put it in the existing style sheet? or do i have to create another one
-
Aug 9th, 2005, 06:49 PM
#8
Re: Iframes
Thats what I meant when I asked if you had an external stylesheet. As in it is stored in a .CSS file and referenced from all you HTML pages. Is that what you have?
I'm guessing not because you don't know here to put that. The second snippet of code I posted goes in the <head> section of every HTML document that uses those styles.
It is also put in the <head> section of the page that is loaded in the iframe.
Does that make sense?
-
Aug 9th, 2005, 06:58 PM
#9
Thread Starter
Hyperactive Member
Re: Iframes
i have everyone of my pages already linked to an external style sheet.
but wenever i go to the #frame part that is the actual frames styles (position so far)
and add a differenty background url it has no effect on the frame wen i view it.
-
Aug 9th, 2005, 07:05 PM
#10
Re: Iframes
Once again: can you upload you source in a .zip or link me to the site so I can see the actual code.
I'm not sure I understand you totally, but I think you are trying to edit the background by changing it like this:
HTML Code:
<iframe src="myFrame.html" style="background-color: #000000;">
When you should be doing it like this:
HTML Code:
<iframe src="myFrame.html">
HTML Code:
<!-- inside myFrame.html -->
<html>
<head>
</head>
<body style="background-color: #000000;">
blah
</body>
</html>
Obviously you would be using classes and external stylesheets, but I think you get the idea.
-
Aug 9th, 2005, 07:56 PM
#11
Thread Starter
Hyperactive Member
Re: Iframes
heres the link to the site...
http://ninjanutz.t35.com/index-framed.php
sry if ur confused..ima explain wat i wanna do once again..
i want to be able to have 2 backgrounds...one for the frame and one for the other parts or at least make the frame background transparent so the underlying background can show through.
but i want to use the existing style sheet so i can keep all my styles in one place.
once again sorry for the confusion
Last edited by ninjanutz; Aug 9th, 2005 at 08:00 PM.
-
Aug 10th, 2005, 05:43 PM
#12
Re: Iframes
Ok. I am going to try to clear up the basic understanding of this again which will hopefully lead to you solving the problem.
When you specify a Source for an iframe an HTML page is loaded inside that frame EXACTLY the same way any HTML page is loaded inside a browsed window. That means that the ONLY thing that control the background of the page withing the iframe is the page that is loaded inside the iframe.
The page that has the <iframe src="blah.html"> tag on it has NO control over what the background color of the iframe is.
An illistraction of this is: If you loaded http://www.google.com inside your iframe, you have no way to change the background then, because it is Google's page.
In other words, if you want to change the background of the iframe then you need to do so through frame-styles.css (which applies to html-framed.php).
I think there is a slim slim slim slim chance that you could set the background-color of your iframe to transparent and get the effect you want (with the pictures), but I really doubt it.
I would say if you really want the effect you are going for then don't use iframes at all, frames are not reccomended by W3C.
PS - Thank you SO much for using proper XHTML, I hate seeing sloppy HTML.
-
Aug 10th, 2005, 08:39 PM
#13
Thread Starter
Hyperactive Member
Re: Iframes
lol yea no prob about the xhtml i read its better and decided to upgrade
-
Aug 10th, 2005, 09:00 PM
#14
Thread Starter
Hyperactive Member
Re: Iframes
i tired putting a <div class=''> tag on each page then use styles to change that background but this ended up overriding all my styles that were preset for those pages. i also tried adding a different background for just the part apprearing in the frame but the background it inserts is way smaller than the size of the whole frame. im gonna try to figure this one out on my own (maybe add it to the individual sections that add enough padding to make it the size of the frame) thank u for ur help eyeRmonkey but if u have any other suggestions feel free to post (i will not resolve this thread until i get it)
Last edited by ninjanutz; Aug 10th, 2005 at 09:06 PM.
-
Aug 11th, 2005, 12:26 PM
#15
Re: Iframes
 Originally Posted by ninjanutz
(maybe add it to the individual sections that add enough padding to make it the size of the frame)
Can you explain that a little better please?
-
Aug 11th, 2005, 11:55 PM
#16
Thread Starter
Hyperactive Member
Re: Iframes
wen i add the background to the id chat in my style sheet (the chat is the text that apprears in the frame immediately wen clicking on the link) it only adds the background to tahts small area of 2 lines. i was thinking of add enough padding to the id chat so that wen the background is shown it is not the full size of the frame.
is this possible?
-
Aug 12th, 2005, 10:34 AM
#17
Re: Iframes
Sorry, I don't what you mean by ID chat. You mean you add a background to a <font> tag or <span> tag? Yes, then the background will only go that far. If you want it to span more of an area it is better to use <div> or a <table>.
-
Aug 12th, 2005, 12:02 PM
#18
Thread Starter
Hyperactive Member
Re: Iframes
i used the div for it but it was still not anywhere near the full size
-
Aug 12th, 2005, 04:04 PM
#19
Re: Iframes
The link to your site doesn't work anymore. Can you show me what you currently have again (with a link perferably).
-
Aug 12th, 2005, 04:44 PM
#20
Thread Starter
Hyperactive Member
Re: Iframes
yea it doesnt work cause i renamed the files its now http://ninjanutz.t35.com/index.php
-
Aug 13th, 2005, 12:32 AM
#21
Re: Iframes
Ok, now that I have the code to view again. What are you trying to do this time? Get a background behind what? The div? I still say you should ditch iFrames all together and just use a table and add the navigation/header stuff to every page. If you are using php you can dynamically write the naviagation/header around each page. That would be a better solution and would load quicker and would fix your background problems.
-
Aug 14th, 2005, 07:00 PM
#22
Thread Starter
Hyperactive Member
Re: Iframes
yea i am using php but im new at it so i wouldnt no how to go about this
-
Aug 15th, 2005, 11:27 PM
#23
Thread Starter
Hyperactive Member
Re: Iframes
k i found out how to do it. it looks complicated but i have a step by step guide. thanx for all the help.
-
Aug 15th, 2005, 11:37 PM
#24
Re: [RESOLVED] Iframes
Ok, I'll skim over the concept incase you are interested. I don't know PHP so I will type out what the code should do:
In the generic template:
HTML Code:
<% figure out how to link documents together in PHP (load a document into this one. Similar to how you load you CSS document into every HTML page. Except you will have many many documents to load into this one (1 document for ever page of your site. It should look something like this: #include src="index.php". In the second code thing below is an example of what index.php might look like. %><html>
<head>
<title>
My Website || <% doc.write sTitle %>
</title>
</head>
<body>
<table>
<tr>
<td>
<!-- Standar naviagation stuff here (that will be on every page -->
</td>
</tr>
</table>
<span class="largeTitle">
<% doc.write sHeaderTitle %>
</span>
<% doc.write sBody %>
</body>
</html>
index.php
HTML Code:
<% declare variables %>
<% sTitle = "Home" %>
<% sHeaderTitle = "My Webpage" %>
<% sBody = "<span class='IntroTest'>welcome to my cool webpage.</span> This is my dynamically generated home page.
<table>
<tr>
<td>
YAY!
</td>
</tr>
</table>" %>
Feel free to ask me to explain any of that if you didn't get it. If you understand it, but don't know how to do it I would reccomend http://www.w3schools.com for PHP tutorials or just google for "PHP includes".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|