CSS - Binding External Css To A Page
Hello.
I appreciate your help very much, (the subject might or might not be directly replated to python) Binding external css (the basic CSS1 standard) file to an html doesn't work. [ It does work if the styles definitions are embedded in the page itself ] I'm using apache on linux and I tried 2 browsers ( mozilla 1.5-3(debian) and konqueror 3.1.5 ) I'm using the very simple example which doesn't work #!/usr/bin/python print 'Content-Type: text/html\n\n' print '''<html> <head> <link href="jazzy.css" rel="stylesheet" type="text/css" /> </head> <body> <h1> hello </h1> </body> </html> ''' and the css file ( jazzy.css) looks like h1 {color: yellow; background: yellow; } p {margin-left: 20px} body {background: red; color:red } Both files are in the same virtual directory and both have full permissions(rw) for everyone. I Idon't have an idea what the problem is. Thanks a lot Roy Similar TutorialsHello. I appreciate your help very much, (the subject might or might not be directly replated to python(I realy don't know what's it related to)) Binding external css (the basic CSS1 standard) file to an html doesn't work. [ It does work if the styles definitions are embedded in the page itself ] I'm using apache on linux and I tried 2 browsers ( mozilla 1.5-3(debian) and konqueror 3.1.5 ) I'm using the very simple example which doesn't work #!/usr/bin/python print 'Content-Type: text/html\n\n' print '''<html> <head> <link href="jazzy.css" rel="stylesheet" type="text/css" /> </head> <body> <h1> hello </h1> </body> </html> ''' and the css file ( jazzy.css) looks like h1 {color: yellow; background: yellow; } p {margin-left: 20px} body {background: red; color:red } Both files are in the same virtual directory and both have full permissions(rw) for everyone. I Idon't have an idea what the problem is. Thanks a lot Roy In my project I have my project folder, in which there are 3 subfolders: CSS, JS & PHP. In my php web files I have a header link to an external CSS file (in the CSS folder) controlling certain styles in each PHP files. Code: <link rel="stylesheet" type="text/css" href="./CSS/Home.css" /> Yet, the CSS is not having any affect in my php file(s). Can any hazard a guess as to what could be causing this? Appreciate any ideas? It could be something obvious. but I'm not seeing it. I was wondering what is best to use? I don't mean standard internal CSS that is hard coded but I would use PHP to build a template before it is spat out to the browser and it would make an external css file into part of the client side source code. I think this would be more efficient for rendering purposes than linking to external CSS files in a document? Any thoughts? It would also help us in building our cacheing engine. Is it possiable for me to add an external font family on a certain text? I mean.. Is it possible for me to use ttf fonts on css to modify my html page? P.S: I hope It makes sense.. because I'm tired hi, it seems like my external css is not working... Code: <link href="print.css" rel="stylesheet" type="text/css"> if i convert it to a internal one, it working fine.... i'm using a ie browser .... so if you know what is the problem or how to slove this problem, please reply me... Thanks alot.... First off, I am a noob, but i learn quickly... I have a cgi site (poor me) and it uses css and javascript, which i am just learning. I noticed that javascript tags refer to an exteral file, since the same fuctions are used on many different pages. The same css definitions are used over and over again also, but they are defined in each page (like 50 or 60 files). Can I create a css only file like my .js files and simply refer to it like i do with javascript? If so what does the format look like? Thanks, JOhn Hello I'm having trouble with displaying a background image in a div. It worked fine with embedded CSS but when I changed the CSS to external, the text loads but the bg image doesnt. I'll post some code to explain it... This is in the external style sheet: #navbgtop { position:absolute; left:38px; top:185px; width:194px; height:18px; z-index:2; background-image: url(images/navbartop.jpg); } and yes of course I have made the proper link to it in the <head> tag: <link rel="stylesheet" type="text/css" href="css/nav.css" media="all" /> For some reason the background image wont display. Any ideas? One more question also, does it matter if I use media="all" for the whole website? Or do I even need to bother using media=xyz ? I heard most browsers don't even read that as of yet. Can you cache external css files (to make pages that use the same css file load faster)? If so, how? BTW, here is how I currently load my css (from zen garden): Code: <STYLE type=text/css media=all>@import url(/main.css); Hi, I'm new to style sheets and hope someone can help me with this question. I can't figure out how to use special characters in a page which refers to an external style sheet. I specifically need to put in an accented "e", and it worked fine in another place which is just an internal sheet, but in the externally referred one it comes out as a gibberbox, looking like a chinese character. I can only assume it has something to do with the difference between the types of css, which is why I bother to make reference to them, but I can't figure out how to get that e to show up right. Help much appreciated.. Maria one of my client's pages is not rendering my external css in mozilla firefox. the page's index is: (URL address blocked: See forum rules) It is in a frameset... the simplest page on my site is (URL address blocked: See forum rules)/leftspacer.html. I cannot get the stylesheet to put the background image in proper alignment. PLEASE HELP! I have this tag in an external css file Code: td { text-align:left; //and yes i know that its left by default } Inside my html file I have a td with alignment set to right, which according to my understanding should override the external css file, however it doesn't. The content is still left aligned. Why is that? Thanks Ok, I just started a new website. I have been putting all of the html on every page. So, when I change one small thing on my Nav Bar, I have to go to every single page and change it! There has to be an easier way, right? Isn't it by using external sytle sheets? I tried this code in my homepage, but it isn't working: Code: <head> <STYLE TYPE="text/css" MEDIA="screen, projection"> <!-- @import url(http://www.freewebs.com/ohhdanggggraphics/BASIC.css); --> </STYLE> </head> Basically on my site the only thing I want to change from page to page is the information in the center table. How would I do this? Thanks for your help My Website Hi. I've places where a div have style="display: block; float left;" and it's only on 1 or few pages. As I go on it still I'm doing this frequently but if I added to the external style it will grow as well but the reason why I do it inline because there isn't much style for a set of div. Also when you specify a external style then is that means it will load once and stay in cache when it loads a page that re-use the external? I'm not expert in CSS and want to know what's the best approach. Thanks. I have been going through the tutorials and forums learning CSS. Everything works and makes sense until I get to the lesson for setting up a div box. For some reason I am missing something here. None of the lessons or forums even address or talk about how to connect or input the external div CSS into the web page. They only show the external CSS code or internal CSS code. They never show what is required in the HTML to pull in the external div CSS. Even when I copy and paste the code from the different lessons I can not get a div box unless I put it in-line in the HTML code with a <style> tag, which defeats the concept of using an external CSS for the div box. How do I link an external CSS div.box to the default.htm web page? What coding is required in the external CSS and in the default.htm HTML to have the div.box brought into the web page? Does the div.box code have to have its own .css file to work? How do I get the external CSS code for the div input to the HTML? Thanks I wrote a simple page using an external style sheet. It works fine on my home computer on both IE and NS but when I look at it from the server NS ignores the external link. Can someone please tell me what is going on. I used an embeded syle and that seemed to work but I would like it to work externally. JG I'm using external style sheets on a couple of sites, and have the following problem: When I click and drag down over the text, to copy & paste it into an email or whatever, all the text on that page is automatically highlighted .... I can't control the drag / selection, it's all or nothing. When I click and drag upwards, nothing happens at all ... it won't work. Any way to solve this? I don't get this problem with internal style sheets. Andy I'm just starting to experiment with external css files and I'm stuck on how to deal with setting color for the links. When I put this in the html page itself it works fine: <style type="text/css"> a:link {color: #FF0000} a:visited {color: #00FF00} a:hover {color: #FF00FF} a:active {color: #0000FF} </style> But when I instead move it to the body section of my external css file and link to that css from my html file, it doesn't do anything (link colors just go back to the default). I know I'm generally setting up the external css file correctly since the other things I set in that external file get picked up correctly (font family, font size, background image, etc.). Any magic to using link colors in an external sheet?? In case it helps, here is my css file: Code: body { background-color: #000033; color: white; background-image:url(balbkgnd.gif); a:link {color: #FF0000} a:visited {color: #00FF00} a:hover {color: #FF00FF} a:active {color: #0000FF} } td { font-size: 12.0pt; font-family: Trebuchet MS; a:link {color: #FF0000} a:visited {color: #00FF00} a:hover {color: #FF00FF} a:active {color: #0000FF} } th { font-size: 12.0pt; font-family: Trebuchet MS; a:link {color: #FF0000} a:visited {color: #00FF00} a:hover {color: #FF00FF} a:active {color: #0000FF} } I styled my form elements with codes below but I am having trouble with styling my radio buttons. I tried fieldset div input.radio, fieldset div radio, fieldset div radioarea none worked. Code: fieldset div input { width:150px; border-top:1px solid #000000; border-left:1px solid #000000; border-bottom:1px solid #aaaaaa; border-right:1px solid #aaaaaa; padding:1px; } fieldset div textarea { width:300px; border-top:1px solid #000000; border-left:1px solid #000000; border-bottom:1px solid #aaaaaa; border-right:1px solid #aaaaaa; padding:1px; Is this possible? Currently onclicking a dynamically created option in my select menu an URL is sent to change the .src of an IFRAME. The external content in the IFRAME does not match my site (it's a portal) style (bg, alignment, font etc.) I want to make it fit in but ofcourse cannot set attributes to external pages. Can the URL be loaded in a 0 size frame or hidden IFRAME and it's contents, the source code, be taken on load and put into a new div tag on my own page with the neccessary style additions? Notably the URL source has it's own style.css, is an alternative to change the href of that style.css onload? =D Mark. I'm using an external style sheet with: p{ text-align: justify; } Within myfile.html I have: <p align="center">My paragraph</p> <p align="left">My paragraph</p> <p align="right">My paragraph</p> I assumed that the html inline would take precedence over the external css but it is not; all of my <p> text is justified! Why? I'm a nube with css and I'm testing. I'm not planning on using the html align, but, if necessary I'd like to know why it is not working as I thought. If I remove the style sheet reference then the <p> statements do work. Help. |