Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

HTML in CSS?

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » DU Groups » Computers & Internet » Computer Help and Support Group Donate to DU
 
Deja Q Donating Member (1000+ posts) Send PM | Profile | Ignore Tue Jan-10-06 12:55 PM
Original message
HTML in CSS?
I am developing a CSS-based menu, but I am somewhat naive as to the fuidity of CSS...

Is it possible to include HTML code in the CSS document and only use the ID tag in the HTML file to reference it?

This would make the menu centralized and inifinitely easier to maintain...

Is this possible?

Thx!
Printer Friendly | Permalink |  | Top
mainegreen Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Jan-11-06 08:45 AM
Response to Original message
1. I'm not totally sure by what you mean by ..
including HTML in the CSS document. So here's a couple of possible answers:

1) HTML may not be included in the CSS definitions page where you define your CSS classes. Classes/styles modify HTML tags, not the other way around.

2) The ID tag doesn't reference anything, it *is* the reference to the tag it is embedded in. It may be used to modify a tags CSS properties, but only really via javascript like so:
document.getElementById('someId').style.display='none';

3) If you want to make your code easier to maintain via centralization (and I whole heartedly approve of that!) you should separate all your menu code, HTML and all into another file and do an include of the menu into each other page where you would normally have had the menu HTML on that page. Here's a php example:

<TR><TD>Here's my menu</TD></TR>
<TR><TD><?php include("mymenu.php"); ?></TD></TR>

with mymenu.php holding the HTML that is your menu. There are many ways to do includes, and it all depends on the scripting language you are using. Heck, you can even do includes without a scripting language (http://www.15seconds.com/faq/IIS%203.0/346.htm">server side includes-IIS, http://httpd.apache.org/docs/1.3/howto/ssi.html">server side includes-Apache).

4) It just gets more complicated from there! :P Seriously though, if you have any questions just send a message to my DU inbox. I'm just doing DB migrations now, and that's boring as hell, so I'd be glad to answer any questions.
Printer Friendly | Permalink |  | Top
 
Deja Q Donating Member (1000+ posts) Send PM | Profile | Ignore Sat Jan-14-06 12:42 AM
Response to Reply #1
2. I stumbled on a way to do it tonight...
Bought a magazine that, in the html code, allows an import command to a CSS file that contains embedded html commands; all that's needed is the relevant ID in the DIV tag in the actual html (index.html) file. It's very clever how it's done...


The problem is, is internet exploiter friggin' capable of running the code? This jackass tiddleywinks toddler browser that they don't care about updating because it's not profitable TO THEM will not run CSS correctly; every other browser will. Naturally, MS prefers their proprietary code to actual standards... :grr:


Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Fri Apr 19th 2024, 07:50 PM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » DU Groups » Computers & Internet » Computer Help and Support Group Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC