SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: span tag

  1. #1
    SitePoint Member
    Join Date
    Jul 2011
    Location
    Grand Rapids, Michigan, USA
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    span tag

    I can't get my span tag to take my styles

    html

    <!--beginning news -->
    <div id="news" class="news"><h3>News</h3>
    <p><span>&raquo;</span> Campbell &amp; Sons lawncare launch new website</p>
    <p><span>&raquo;</span>Campbell &amp; Sons lawncare celebrates 15 years in business</p>

    </div>
    <!--end news -->


    css
    span {
    color: #ff611a;
    font-size: 24px;
    }

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,296
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    It seems to be working:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Untitled Document</title>
    <style type="text/css">
    span {
        color: #ff611a;
        font-size: 24px;
    }
    </style>
    </head>
    <body>
    <div id="news" class="news">
        <h3>News</h3>
        <p><span>&raquo;</span> Campbell &amp; Sons lawncare launch new website</p>
        <p><span>&raquo;</span>Campbell &amp; Sons lawncare celebrates 15 years in business</p>
    </div>
    </body>
    </html>
    The problem must lie elsewhere.

    It's either specificity, typo or bug but we will need a working demo of the problem to give further advice.

  3. #3
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,791
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    what you need to look for are other rules with span on it ( or even rules with "*")

    anything similar to :

    p span {
    color: some color
    font-size: some size;
    }

    or
    #news span {
    color: some color
    font-size: some size;
    }
    or
    .news span {
    color: some color
    font-size: some size;
    }

    ..etc

    also if you had anything like

    p * { rules:rules...}
    or
    .news *{rules...}
    it would affect your span as well

    BTW, why do you have a class "news" and an an ID "news"? chances are you could amalgamate your rules in #news and get rid of class news.. but one would have to know what you intend to do do to be certain.


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
  •