Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tags 1

Status
Not open for further replies.

calista

Programmer
Jan 24, 2001
545
US
This is probably a stupid question, but this is my first attempt at a style sheet. Can I define my own tag to use a selector(TopStyle), or do I have to use a standard HTML tag?

Thanks! :)
 
Calista, I'm not sure I know what you mean? Could you give a little more detail. I use TopStyle as well. Kevin
slanek@ssd.fsi.com
 
Well, for example, I am creating a tag to highlight certain words. My script follows:
Code:
STRONG {
	background : Navy;
	font-size : larger;
	color : White;
}
So, I've redefined the STRONG tag, and any text I surround with the STRONG tag will appear as white letters on a blue background.

Can I make up my own tag (e.g. <HL></HL> for HIGHLIGHT)? I tried replacing STRONG with HL in the above script, and nothing happened. Thank you for your help!
 
Ok, I get it. Sure, you could use a class or id or something. For example, say I wanted to use a class. I could say:
Code:
.highlight /* this can be called anything I want */
{
   background : Navy;
   font-size : larger;
   color : White;
}

Then in my HTML code I would use it like so:
Code:
<DIV CLASS=&quot;highlight&quot;>
   The stuff to highlight goes in here...
</DIV>

You can apply a &quot;class&quot; attribute to just about anything. For example you could have table cells like:
<TD CLASS=&quot;...&quot;> You're pretty much unlimited. Look at the CSS stuff at Some good stuff there.


Kevin
slanek@ssd.fsi.com
 
Hi calista!
You can NOT define your own tags. What you can do is to redefine the existing ones using:
1. classes: .classname { }
2. selectors: #selector { }

You may even combine both of them like this:
<p class=&quot;this_one&quot; id=&quot;that_one&quot;>

It's quite enough to create anything you want.
 
Thanks, guys! That'll get me going!

Calista
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top