PDA

View Full Version : Using IFrames in CSS Code



pluggen
February 25th, 2002, 23:35
Can someone give me the correct codes to insert Iframes into my CSS coding. I use the external linking thing.. Also how do i get the Iframe to target to a table?

Thanks..

Apsylus
February 26th, 2002, 19:16
If your asking for what i think your asking all you need to do is Give the Iframe a name. <iframe src=blah name="randomname"></iframe>

then make the link target the frame.

if your trying to make the CSS set the target its just
.classname { src: url();}

<iframe class="theclassname you gave the code"></iframe>

either that or your missunderstanding what an Iframe does.

meow
February 26th, 2002, 21:27
u2:biggrin2:

pluggen
February 27th, 2002, 19:54
Thanks that did help me .. it took me little to figure it out though.

:)

meow
February 27th, 2002, 20:11
That was because it's wrong. Total mumbo jumbo. :biggrin2:
There is no .classname { src...}
Let us know if you still need help. I didn't understand your original question though.

pluggen
February 27th, 2002, 23:34
I didn't understand my question either. :D

But here's my situation.

pluggen
February 27th, 2002, 23:42
In the "mystyles.html" i want add the "target=" script... how would i add it into there?

I'm not sure if i'm making any sense but, tell me if i'm not.. thx

index.html


<LINK REL=stylesheet HREF="mystyles.html" TYPE="text/css">
</HEAD>
<BODY>
<div id="floatframe">
<iframe width=650 height=550 src="main.html" scrolling=auto border=0></iframe>
</div>
<div id="layer2">
<a href="links.html">Links</a>
</div>

main.html


<LINK REL=stylesheet HREF="mystyles.html" TYPE="text/css">
</head>
<body>
</body>

mystyles.html


body { margin:50px 0px; padding:0px;
text-align:center; }

#layer2 { width: 150pt; height: 700pt; overflow: auto; position: absolute; left: 0px; top: 0px; target: url(/index.html) }
A:link { text-decoration: none; color: blue }
A:visited { text-decoration: none; color: red }
A:active { text-decoration: none }
A:hover { text-decoration: none; font-weight: bold; font-style: italic; font-size: 16; color: black; background: LemonChiffon }

#floatframe {position:absolute;
right: 0px;
top: 0px;
width: 15px;
height: 10px;
z-index: 100 }

Apsylus
February 28th, 2002, 05:26
Ok first thing.

A Cascading Stylesheet is normally given a .css extension

second thing.

To set Link targets all you need to do is put the target= in the <a>...</a> tags for the link, and give the Iframe a name "name=" or "id=". the target would be target="framename".

meow
February 28th, 2002, 07:22
Yes, your style sheet must be named .css. No exceptions.

I still don't understand what you mean with "In the "mystyles.html" i want add the "target=" script". You want to put the path to the page the iframe should show in your CSS? Can't do that. That's a job for HTML, not CSS.

pluggen
February 28th, 2002, 21:53
Mucho thanks for the help.

I have another question.
Does it effect anything if you don't have the css extension. What difference does it make if you do and don't have the ".css" extension.

meow
February 28th, 2002, 22:07
Just the little difference that it won't work. What's the problem? You aren't allowed to upload css files? :eek: :confused:

pluggen
March 1st, 2002, 02:15
Yeah... i'm not allowed to..

although it seems to be working fine with the .html extension

Apsylus
March 1st, 2002, 08:35
:confused2 :confused: Not allowed to upload css files? I be thinking you need to find a host with some common sense :p

That or use <style type="text/css">css stuff </style> In the head of your pages.

meow
March 1st, 2002, 11:48
Locally it seems like .html works but not .txt for instance. But the problem is bigger. CSS files must be delivered (by the server) with the content type text/html or more intelligent browsers like Moz won't take it. So how to tell the server this html file is text/html but this is text/css?

Change host for Pete's sake. Or put the CSS file on a server that allows it. ;)

pluggen
March 1st, 2002, 18:56
I appreciate both of you for helping me… Thanks

I'm kinda a newb with css... i've been working with it for about a week now and i'll get better and more familiar with how css operates. I want to study 'tables' next (in css format). Are they still necessary with css?

Again .... Thanks