...

View Full Version : How Do I Reference a Class Without Applying an HTML Element?



duderdude2
02-25-2005, 12:13 AM
I know I can apply a class to a sentence like this:

<b class="videodescription"> This is the text I don't want bolded</b>

However, is there a way to do that without applying the bold? I hope this makes sense.

rmedek
02-25-2005, 12:23 AM
Dude. Duder. Duderino (if you're not into that whole brevity thing). Sorry... Big Lebowski attack.

<span class="whatever">A span is a meaningless element used to apply style to inline elements.</span>

duderdude2
02-25-2005, 12:32 AM
Awesome, that worked great. Thanks!

One more CSS, but unrelated question:

If I'm referencing an external style sheet, that should be in the header, right? Also, is it a bad thing that I have an actual <style type="text/css"> right below it? So in essence, two style commands in the header?

Here's the page I'm talking about specifically (they're right below the "Title" in the source code):
http://www.gamexplain.com/whyxplain.shtml

rmedek
02-25-2005, 12:52 AM
If I'm referencing an external style sheet, that should be in the header, right?
Yep.


Also, is it a bad thing that I have an actual <style type="text/css"> right below it? So in essence, two style commands in the header?
Not really... I mean it's not bad, it just means if you need to change the css you'd have to go to every page you have it on, rather than the external stylesheet. Unless you're overwriting something by mistake it's not going to do anything harmful.

The Dude abides...

duderdude2
02-25-2005, 12:56 AM
Thanks very much.

Actually, for my headline, I'm using an "Include," so I only have to change one page =)

Scootertaj
02-25-2005, 12:56 AM
Ok, say that you have an external style sheet has these properties for the h3 selector:



h3
{
color: red;
text-align: left;
font-size: 8pt
}


and an internal style sheet that has these properties for the h3 selector:


h3
{
text-align: right;
font-size: 20pt
}


If the page with the internal style sheet also links to the external style sheet the properties for h3 will be:


color: red;
text-align: right;
font-size: 20pt


Hope that helps!

PS This was taken directly from W3 Schools CSS Tutorial (http://www.w3schools.com/css/css_howto.asp)
under Multiple style sheets

duderdude2
02-25-2005, 01:16 AM
Thanks for the link Scootertaj.

duderdude2
02-25-2005, 07:12 PM
One more problem I'm having:

It seems that Mozilla Firefox is not reading the CSS information for particular sections. You can see it on this page:
http://www.gamexplain.com/questions.shtml

The section headlines "-About-", "-Payment-", and "-Technical-" (not the ones at the very top, but the ones in the actual FAQ itself) are not being formatted to what the CSS says. The text should be appearing larger than it is; Internet Explorer is doing it with no problems. Why might this be?

Thanks.

bazz
02-25-2005, 07:48 PM
well I saw this in your code

a:link.samecolorlnklnk{color:#000099; text-decoration: none; font-weight: normal; font-style: normal;}

but the calling used the name 'samecolorink'. All I could see at a glance.

bazz

duderdude2
02-25-2005, 07:53 PM
Good catch, thanks. That did indeed solve my link problem.

However, with the "-about-" further down on the page, the CSS isn't being applied to that, but it works in Internet Explore. I am referencing an external sheet, if that matters.

Thanks for the help!
-----

Edit: Actually, here's a better example:
http://www.gamexplain.com/contact.shtml

See the "contact" at the top? In IE, it's bolded, as I wanted it. But in Firefox, it's not showing up bolded, despite the CSS telling it to.

Puffin the Erb
02-25-2005, 07:55 PM
You do not put tags in external StyleSheets.
For example questions.css looks like this:

<STYLE type="text/css">
<!--
.questions { font-family: arial,sans-serif; font-size: 12pt; color: black }
-->
</STYLE>

It should like like this:

.questions { font-family: arial,sans-serif; font-size: 12pt; color: black }

duderdude2
02-25-2005, 07:56 PM
Woo, that solved it. Thanks so much Puffin the Erb, that's good to know.

Puffin the Erb
02-25-2005, 08:00 PM
np.
This is a good example of why Internet Explorer should not be relied on for testing - it is far too forgiving and ignores open standards, making up its own instead.

Scootertaj
02-25-2005, 10:08 PM
Thanks for the link Scootertaj.

No problem, W3Schools has been a big help to me!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum