SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru
    Join Date
    Nov 2000
    Posts
    741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Overriding a class

    I have this code:
    Code:
    <div id="one" class="like-locker blue">
    So there will be formatting for the class. But I want to override the class formatting and add my own.

    Do I need to use inline?

    If I wanted to add say padding, can someone tell me how I would modify the line of code above?

    Thanks,

    Jon

  2. #2
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Is something preventing you from either modifying the CSS of the classes already applied (presumably in an external stylesheet), or creating a new class that applies the styles you require?

  3. #3
    SitePoint Guru
    Join Date
    Nov 2000
    Posts
    741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look at the popup here: Popup test | Funny Daily News

    The frame around the facebook text is too close so I would like to add more padding.

    The popup displays a php widget, so I can put html in there. It also has a shortcode that brings in the facebook Like button and border. But I can't and don't want to edit the css of the classes because it will be used in other parts of the site in a different way.

    Any ideas?

  4. #4
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    On that page I can see "Popup test Written by Jon on August 16, 2011 Any old text." but no sign of any functioning pop up, Facebook Like button or the HTML markup shown in your first post.

  5. #5
    SitePoint Guru
    Join Date
    Nov 2000
    Posts
    741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, it was set for Administrators only! Guests can see now too.

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,323
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    You could try something more specific like

    Code:
    .php-textwidget #one {padding: 4px;}

  7. #7
    SitePoint Guru
    Join Date
    Nov 2000
    Posts
    741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That was perfect. Thanks ralph!


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
  •