CSS - Problem With Link Formatting In External Sheet
Hi...
I have a slightly confusing problem. I have an external sheet which all works fine except the colour of links before they are visited, active, etc. (It worked fine but one day stopped without any intervention on my part that I know about!) The active link, visited link and hover link colours work as required and as specified in the external sheet, but it is the original link that does not, defaulting to the, erm, default colour. My external sheet is as follows: body {background-image: url("images/logo.jpg")} type="text/css"; a:link {color: #c0c0c0;} a:visited {color: #FF80FF;} a:hover {color: #FF00FF;} a:active {color: #FF80C0;} h1.c1 { text-align: center; font-size: 46pt; color: #bb8ec8 } h1.c2 { margin-left:130px; font-size: 26pt; color: #bb8ec8 } h4 { text-align: center; color: #b15fb8 } Any idea why is isn't working? Cheers Similar TutorialsHi, I have a XHTML 4.0 file and CSS in a separate file. The CSS if included within the <head> section of the HTML file works correctly and displays the page with the right formatting. However, when I move the CSS to a separate file and just use the <link> tag within the <head> section of the HTML file to link to this CSS file, the formatting is not applied. I am not sure what to do. Any quick help is greatly appreciated. Thanks xworder I'm working on a project for school, I'm nearly done, but for some reason, in Firefox the first link in my navigation menu doesn't fit the formatting of the rest. The link is 'About Us'. Please see he http://lovemeforme.org/testing/ any ideas? I'm stumped! 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 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. Hi all, very new at this so please pardon. I am attempting to format a series of 3 columns (using the CSS holy grail) into the main body of a .asp page. Everything goes smoothly, I have the columns looking exactly as I want them, however the style sheet appears to be causing problems with the header and footer of my asp page. Namely, it has caused the previously smoothed corner images (.gifs) in the header and footer to have a 90 degree thick white border around them. I assume that my style sheet for the body of the page is affecting elements in the header and footer as well, causing them to look odd. Is there a way to have a style sheet only affect part of my code locally and not all of it globally? Or make certain parts of my code immune to the style sheet via some sort of markup? Thanks! FYI for those interested: the style sheet I am trying to use to format my divs (frame(content left, content right, content center and content header)) is body { text-align:center; border:0px solid #000; } #frame { width:830px; margin-right:auto; margin-left:auto; margin-top:auto; padding:0px; text-align:left; } #contentleft { width:175px; padding:0px; left:auto; top:auto; float:left; background:#fff; border:0px solid #000; } #contentcenter { width:480px; padding:10px; float:left; text-align:left; background:#B7C8EE; } #contentright { width:175px; padding:0px; right:auto; top: auto; float:right; background:#fff; border:0px solid #000; } #contentheader { background:#345EA2; width:auto; } p,h1,pre { margin:0px 10px 10px 10px; } h1 { font-size:14px; padding-top:10px; } #contentheader h1 { font-size:14px; padding:10px; margin:0px; } #contentright p { font-size:10px} The .asp page I want to use this style sheet on is <!--#include file="headerauth.asp"--> <meta http-equiv="Content-Language" content="en-us"> <body topmargin="0" leftmargin="0"> <link rel="stylesheet" type="text/css" href="sddm.css" /> <link rel="stylesheet" type="text/css" href="box2.css" /> <STYLE> A:link {font-weight:bold} A:hover {background:white;} A:hover {background-color:white;} A:visited {color:green} A:active {color:red} </STYLE> <!--#include file="footer.asp"--> The sheet appears to be affecting both my headerauth.asp and footer.asp which I do not want it to do. Is there a way to stop it from propogating to both of these other files? Or perhaps wrap the code for each of these in some sort of a tag that tells it not to use the css? Hi All, How can i apply style to following table? Class attribute is not working. following is the code. function links(){ var xmlDoc=new ActiveXObject("Microsoft.xmlDOM") xmlDoc.async="false"; xmlDoc.load("ticker.xml") ; xmlObj=xmlDoc.documentElement; nodes=xmlDoc.documentElement.childNodes; document.write("<table border=1 align=left >"); for( var count = 0; count<nodes.length; count++){ document.write("<tr>"); document.write("<td>"); document.write("<a href='" + (xmlObj.childNodes(count).getAttribute('URL')) + "'>" + (nodes.item(count).text) + "</a><br>"); document.write("</td>"); document.write("</tr>"); } document.write("</table>"); } Please guide me for the same. Thanks in advance I need to modify an external style sheet so that background images on each page can be changed. Please help I've been involved in building an intranet site with about 1200 pages. Now that it's been launched we've found problems in printing many of the pages - there are blank pages printing before the content, probably because of floated divs being pushed down when the width is restricted to A4. (That's a guess). Now I know that what we should have done was create a print style sheet which would have solved this problem easily, but if we do that we'll have to place the link to it in every page, which involves quite a lot of signing-out of 1200 pages etc. I'm prepared to do that if there isn't another way but I wondered if there's any way the existing external style sheet can be amended so it loads (imports) the print styles dependent on some statement or other. I'm doubtful, but if anyone knows of a method that involves editing the one stylesheet rather than the 1200 pages I'd love to hear it! Hey, I'm a CSS noob, and I'm having some trouble with centering the content of my page. When I have the coding as an internal style sheet the page is centered, but when I put it in an external style sheet it looks the exact same...except for that it's left aligned. All I do is copy and paste it, but it change the layout around? Any tips? Hi. In my external style sheet i have this: Code: body { margin-left: 100; margin-top: 0; margin-right: 0; margin-bottom: 0; } I am completely new at CSS and am only doing it because supposedly my tables are out of fashon! Thanks Matt I hardly ever use css for thimgs like backgrounds, but I have a freelance client that has alot of interesting ideas about how a good website should look so I'm trying to make him happy. When I have: body { background: url('resources/assets/background.jpg') no-repeat bottom left; } in the extranal css it doesn't work. If I put it into the page it works fine. None of the online css resources I've looked at mention why this should be. I've even tried using the complete http://www.server.com/blah/blah/ address and I get the same results. Does this just not work from an external css, or am I missing something? Thanks y'all. I am trying to use the following in my external style sheet for my links: Code: a:link, a:visited{ color: #006699; text-decoration: underline; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; } a:hover { color: #006699; text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; } a.big { color: #006699; text-decoration: underline; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; } a.big:hover { color: #006699; text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; } a.bigger { color: #006699; text-decoration: underline; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 17px; font-weight: bold; } a.bigger:hover { color: #006699; text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 17px; font-weight: bold; } My problem is that I can't get big & bigger to work properly in Internet explorer. When I hover over the link it goes to its proper size but when not hovering it stays at 11px. I am using a single gif file as an image sprite and want to link the file name in another style sheet so i can reuse this sheet without having to have many copys of the style sheet with a different file names example: Currently like this Code: #store{left:-200px;width:158px;} #store{background:url('mred.gif') -150px -161px;} #store a:hover{background: url('mred.gif') -150px 0;} #fourms{left:0px;width:158px;} #fourms{background:url('mred.gif') -304px -161px;} #fourms a:hover{background: url('mred.gif') -304px 0;} want like this #home{left:-200px ;width:150px;} #home{background:inherit;background-position: 0 -161px;} #home a:hover{background-position: 0 0;} with the background:url('mred.gif') specified in another style sheet once insted of repeating over the entire sheet. effectively so i can just change the other external style sheet to change the gif file and keep this one the same. HOW? possible? When viewing my website, the font is too small in IE/Opera/Crazy Browser. I am a Firefox user and the site looks the way I want when viewed in Navigator & Firefox. I don't want to change that. I'm thinking that I can use java script to make a page link to a specific style sheet, based on the user's browser. Unfortunately, I'm not a scripter and I haven't managed to find one that suits my purpose. Is there a simpler way to accomplish this? Thanks 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 have a rule called #MainContent. Now I want to change this rule for just one page so I duplicate it but don't add it to the global style sheet but declare the rule for this page only. However this doesnt work the div still changes based on the #MainContent rule in the global css file I've run up against a css problem with the homepage on this site under development. In IE8 the right column in the main content area contains an image swapper and the column pushes out beyond the page content area. It displays properly in FF3. I've tried a variety of margin, padding and width changes without success. How do I correct this for all IE and FF browsers? To avoid bloat I have not included the stylesheet here, but it can be viewed in FF. Hi, I have modified a form for a web blog for a friend, and got extra fields included for them. But we have an issue on the pc with internet explorer and the position of the elements in css. On safari and opera and firefox, all the labels for the form tags line up correctly, but on internet explorer they do not, the message label is lined up with the address, how can we fix this. If you look at this page: http://website-traffic.inpress.co.uk/contact-us/ You can see what we mean with the form. How can I fix this problem with the css to get them all correctly lined up. Many thanks Barry 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 Hello! I am new to these forums and would like to get some advice or help on something. First of all is it possible to have more than one CSS menu in a web page? and if so, how do you get them to both work without conflicting? Here is the deal. I am wanting to put a sheet that gives me a nice menu bar. But when I put it in, it messes with the entire page. It conflicts with the original sheet for that page and rearranges everything. Anything will be helpful at this point. Thanks in advance. apollo |