Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New Coder
    Join Date
    Jan 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How Do I Reference a Class Without Applying an HTML Element?

    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.

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    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>

  • #3
    New Coder
    Join Date
    Jan 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Quote Originally Posted by duderdude2
    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...

  • #5
    New Coder
    Join Date
    Jan 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks very much.

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

  • #6
    Regular Coder
    Join Date
    Sep 2004
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, say that you have an external style sheet has these properties for the h3 selector:

    Code:
    h3 
    {
    color: red;
    text-align: left;
    font-size: 8pt
    }
    and an internal style sheet that has these properties for the h3 selector:
    Code:
    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:
    Code:
    color: red; 
    text-align: right; 
    font-size: 20pt
    Hope that helps!

    PS This was taken directly from W3 Schools CSS Tutorial
    under Multiple style sheets

  • #7
    New Coder
    Join Date
    Jan 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the link Scootertaj.

  • #8
    New Coder
    Join Date
    Jan 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #9
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    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
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #10
    New Coder
    Join Date
    Jan 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Last edited by duderdude2; 02-25-2005 at 07:55 PM.

  • #11
    Regular Coder
    Join Date
    Oct 2004
    Posts
    168
    Thanks
    0
    Thanked 5 Times in 5 Posts
    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 }

  • #12
    New Coder
    Join Date
    Jan 2005
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Woo, that solved it. Thanks so much Puffin the Erb, that's good to know.

  • #13
    Regular Coder
    Join Date
    Oct 2004
    Posts
    168
    Thanks
    0
    Thanked 5 Times in 5 Posts
    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.

  • #14
    Regular Coder
    Join Date
    Sep 2004
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the link Scootertaj.
    No problem, W3Schools has been a big help to me!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •