SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: CSS Help

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How would I make everything in the left nav bar bold, while leaving everything else as is?
    http://www.cisites.com

  2. #2
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    define a class with the following attribute:

    Font-Weight: Bold;


  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But how exactly would that be done? I put the font-weight description in there, but the whole page turned bold.

  4. #4
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The following in your header:

    Code:
    <STYLE>
    .bold {Font-Face: blah; color: blah; text-decoration: blah; font-weight; bold;}
    </STYLE>
    The following in your page:

    Code:
    <font class = "bold">Text to be bold</font>
    I like to use the font tag when defining things in CSS, basically because it'll only define font attributes, if I define them in the A tag it'll only work for links, if I define them in a p tag I get a new paragraphy. But in anycase in just about any tag you can enter class="bold" and it'll make the text inside bold.

  5. #5
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cisites
    The best thing to do would be to go and check out what http://www.webmonkey.com has to say about Stylesheets. Or you can view source on someones page. Here is a good example of the syntax for Stylesheets. http://www.dreamingpig.com/nacho It's a site that I built for my dog so it's nothing special, but the code is clean and I use stylesheets quite a bit.

    Good luck...stylesheets are way cool

  6. #6
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still not working right...

  7. #7
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is what you have in your header:

    Code:
    <style type="text/css">
    <!--body { font-family: "Verdana"; font-weight: bold;} a { text-decoration: none; }-->
    <!--td {font-size: 10pt; } -->
    </style>
    </head>
    First of all remove those comment tags and format that up:

    Code:
    <style type="text/css">
    body { font-family: "Verdana"; font-weight: bold;} 
    a    { text-decoration: none; }
    td   { font-size: 10pt; } 
    </style>
    </head>
    Now to do what you want, make it look like this:

    Code:
    <style type="text/css">
    body { font-family: "Verdana"; font-weight: bold;} 
    a    { text-decoration: none; }
    td   { font-size: 10pt; font-weight: bold;} 
    </style>
    And everything within a table cell should be bold.

    You can define CSS properties by Tags or classes or both.

    A.NAV {text-decoration etc etc etc} - Example of Both
    .NAV {text-decoration etc etc etc} - Class Example
    A {text-decoration etc etc etc} - Tag Example

    The first example will effect text within A tags that are also of the class "nav"

    The second example will effect text within any tag that is class "nav"

    The third example will effect text within A tags so long as there is not a class definition that supercedes it.

    Chris



  8. #8
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aspen...you know that if you style a table cell, it won't show up properly in Netscape. Your best bet would be to use a class. Like this:

    .td_bold {font-size: 10pt; font-weight: bold; }

    Then you apply that class to a span tag like this.

    <span class="td_bold">this text will be bold</span>

    It is little more coding, but it will help ensure the whole cross-platform issue.



Bookmarks

Posting Permissions

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