ldsmike88 Posted February 12, 2007 Share Posted February 12, 2007 I have a javascript menubar at the top of my page that defines the colors and everything for the font of the menubar, but when I look at it online the font colors and sizes are different because my css file overwrites the javascript when it displays it. Is there anyway to exclude that area of the page from the css file? Maybe php could help somehow... Thanks! Michael Quote Link to comment Share on other sites More sharing options...
steelmanronald06 Posted February 12, 2007 Share Posted February 12, 2007 You could go into the CSS and A) Comment out that code block B) If some other code requires that bit of CSS, then rename that CSS block to something else then go to to the code that requires it and rename it to match. Then delete the problem block and use your javascript. Quote Link to comment Share on other sites More sharing options...
ldsmike88 Posted February 12, 2007 Author Share Posted February 12, 2007 How do you comment out a code block? Or how could you close or end a CSS script? Quote Link to comment Share on other sites More sharing options...
ldsmike88 Posted February 12, 2007 Author Share Posted February 12, 2007 You can start using php by typing '<?' and you can close it by typing '?>'. Can you do the same thing with css? Something like <link href="index.css" rel="stylesheet" type="text/css"> to open it and </link> to close it? Is that possible? Quote Link to comment Share on other sites More sharing options...
Balmung-San Posted February 12, 2007 Share Posted February 12, 2007 <link> is a one shot tag. There is no closing tag to it. Comments in CSS work like comments in most languages, using // and /* */. Quote Link to comment Share on other sites More sharing options...
ldsmike88 Posted February 12, 2007 Author Share Posted February 12, 2007 But I'm not really commenting in css. For example: <html> <head> <link href="../index.css" rel="stylesheet" type="text/css" /> </head> <body> <script type="text/javascript" src="../javascript/admin.js"></script> //Everything else. </body> </html> How do I apply the css to the "Everything else" but not to the javascript? Sorry for suck a stupid question but I don't know what to do. Quote Link to comment Share on other sites More sharing options...
Balmung-San Posted February 12, 2007 Share Posted February 12, 2007 The JavaScript not giving classes or ids to the menu and its items. I would find out what the JavaScript uses for its menu, and what it classes or ids them with, then do the corresponding styling in your CSS. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 that doesn't make sense - the javascript won't have a style...it's not html. Quote Link to comment Share on other sites More sharing options...
ldsmike88 Posted February 12, 2007 Author Share Posted February 12, 2007 The javascript writes text in html so it gets the css applied to it. Quote Link to comment Share on other sites More sharing options...
Balmung-San Posted February 12, 2007 Share Posted February 12, 2007 The javascript writes text in html so it gets the css applied to it. But apparently it writes out bare HTML, as opposed to HTML with classes or ids. You need to make it output the HTML with classes or ids in order to style them individually. Also, they will inherit from the parent style unless you override it with a new style in the CSS declaration. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 So make that text have it's own class, and apply the style you want to it. Quote Link to comment Share on other sites More sharing options...
ldsmike88 Posted February 12, 2007 Author Share Posted February 12, 2007 OK, I got it to look almost the way I wanted it to. Thanks for the help! Michael Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.