NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Web Design Discussion
Reload this Page CSS Styles and IFRAMES problem...

Web Design Discussion Discussion of web design techniques, advice, browser issues, software, design firms.

Advanced Search
9 members in live chat ~  
NamePros Design Contests NamePros Design Contests
Forum Sponsorship
Join in on the FUN! You can start an affordable design contest and pick from entries talented members submit or you can enter a design contest for a chance to win CASH PRIZES! What are you waiting for? Get started in the fun TODAY! - Banners, Logos, Mascots, and MORE! (Please READ the design Contest section rules Prior to starting or entering a contest)



Closed Thread
 
LinkBack Thread Tools
Old 04-13-2005, 05:52 PM THREAD STARTER               #1 (permalink)
New Member
Join Date: Apr 2005
Posts: 3
makermet is an unknown quantity at this point
 



CSS Styles and IFRAMES problem...


When including an html source file in an IFRAME tag, it doesn't retain the CSS styles that it does if you view the source file separately.

It doesn't seem to take on the CSS Style of the current document either, nor can you tell is to use any particular styles as per the 'STYLE' attribute inside the tag (since it only refers to the actual border properties of the IFRAME).

Does anybody know a way aorund this...i.e. a way of making it work?!!! HELP!

Thanks in advance.
makermet is offline  
Old 04-13-2005, 10:46 PM   #2 (permalink)
NamePros Regular
Join Date: Nov 2003
Location: Melbourne
Posts: 762
trishan has a spectacular aura abouttrishan has a spectacular aura about
 



Is the webpage in the iframe your own or from another site?
trishan is offline  
Old 04-14-2005, 06:16 PM   #3 (permalink)
NamePros Regular
 
Nitroshock's Avatar
Join Date: Mar 2005
Posts: 503
Nitroshock is a splendid one to beholdNitroshock is a splendid one to beholdNitroshock is a splendid one to beholdNitroshock is a splendid one to beholdNitroshock is a splendid one to beholdNitroshock is a splendid one to beholdNitroshock is a splendid one to beholdNitroshock is a splendid one to behold
 


Child Abuse Third World Education
CSS styles don't carry over on frames.

My suggestion is to put all your CSS in one file, then reference that file from each of the HTML pages you want to use that style sheet.

Code:
So if your CSS file is named "layout.css", 
you would put something like this in your html files

<LINK REL="STYLESHEET" TYPE="text/css" HREF="layout.css">
You could also copy your CSS from one file to the other (keeping it inline) but then any changes require modifying multiple files.
????: NamePros.com http://www.namepros.com/web-design-discussion/82476-css-styles-and-iframes-problem.html

Hope this helps.
-Nitro
__________________
Bored? Play FREE Games
Nitroshock is offline  
Old 04-14-2005, 07:41 PM   #4 (permalink)
NamePros Regular
Join Date: Apr 2005
Location: Florida
Posts: 215
ScionStatic is on a distinguished road
 



Hello,

This is what you need to do. Open up the source file of your iframe. Now add the following between your closing title tag and the closing header tag.

<style type="text/css" media="screen">

<!--Place all your CSS coding that was in the CSS file that you had linked to this page, in here-->

</style>

So the top part of the webpage (this is the webpage that is used as the source for your iframe) would look like the following.

<html>
<head>
<title>The Use Of CSS With Text</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" media="screen">
????: NamePros.com http://www.namepros.com/showthread.php?t=82476

body {margin-left:15%;
margin-right15%;}

p {font-weight:bold;}

</style>
</head>

<body>

Now the CSS will be different of course, but that's how you need to have it (structure wise). That should fix everything!

God bless,
David
ScionStatic is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 07:23 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger