1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help: Removing a Span Id using CSS

Discussion in 'CSS' started by locals, Aug 29, 2015.

  1. #1
    I need help removing this link and I feel like css would be the best way to do it.

    
    <span id="toTopHover" style="opacity: 0;"></span>
    
    Code (markup):
    I have tried both of these and none of these work :/
    SEMrush
    
    #toTopHover { display: hidden;}
    
    
    #toTopHover { display: none;}
    
    
    Code (markup):

    Thank you in advance for your help
     
    locals, Aug 29, 2015 IP
    SEMrush
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Uhm... if it has "opacity: 0" it shouldn't show to begin with. This is an example on not showing us the whole thing, or the page in question - it doesn't really help. "display: none" should work as well, but since you haven't shown us where you're putting the CSS vs. the rest of the CSS-file, and what kind of other CSS you have pertaining to that particular span, it's very hard to help. Either show us the actual page, or all of the code for the page in question (both HTML and CSS).
     
    PoPSiCLe, Aug 29, 2015 IP
  3. locals

    locals Well-Known Member

    Messages:
    1,677
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    153
    #3
    Okay thanks, let me gather some more information for you guys to help me.

    It is one of the to top of page arrows in the footer of a page, that when you hover over it it fades from a dark color to a lighter color. But let me gather some solid info for you
     
    locals, Aug 30, 2015 IP
  4. COBOLdinosaur

    COBOLdinosaur Active Member

    Messages:
    515
    Likes Received:
    123
    Best Answers:
    11
    Trophy Points:
    95
    #4
    If it is changing on hover then changing the rule with the id as the declaration may not help, because there is probably another rule with :hover specified. Also seeing an inline style attribute indicates the whomever wrote it is either incompetent or intentionally trying to make maintenance difficult to discourage removal of the link which sounds like it is part of either a scam ot some kind of blackhat SEO crap. The hover could also be getting fired from an even fired inline or from an event listener in a script.

    Why not just remove the span from the markup? Oh... it probably is coming from a theme or plugin; in which case you deserve the headache it is causing for using something that generates crap code.
     
    COBOLdinosaur, Aug 30, 2015 IP
  5. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    6,423
    Likes Received:
    1,379
    Best Answers:
    24
    Trophy Points:
    400
    #5
    It looks like some kind of wordpress issue. There's this whole nonsense going around that link, something like:

    <a href="#" title="<?php _e('To Top','smartblog'); ?>" id="toTop" onclick="return false;" style="display: inline;"><span id="toTopHover" style="opacity: 0;"></span><?php _e('To Top','smartblog'); ?></a>

    But it could be something else. If it is what you're dealing with, just change that style="display: inline;" to style="display: none;"
     
    Last edited: Aug 30, 2015
    qwikad.com, Aug 30, 2015 IP
  6. COBOLdinosaur

    COBOLdinosaur Active Member

    Messages:
    515
    Likes Received:
    123
    Best Answers:
    11
    Trophy Points:
    95
    #6
    Turdpress is an issue. If you look up crap in the dictionary you will find the WP logo.
     
    COBOLdinosaur, Aug 30, 2015 IP
    deathshadow likes this.
  7. billzo

    billzo Well-Known Member

    Messages:
    961
    Likes Received:
    278
    Best Answers:
    15
    Trophy Points:
    113
    #7
    One problem I have had modifying Wordpress themes is overriding existing rules due to specificity. The best option is to use Firefox's (or another browser's) Web Developer Tools and see exactly what rule(s) apply to it and then attempt to override it using that. Or try using !important. Or a targeting selector (or combination) with a higher specificity score.

    https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
    http://www.w3.org/TR/selectors/#specificity
    http://www.w3.org/TR/CSS2/selector.html
     
    billzo, Aug 30, 2015 IP
  8. locals

    locals Well-Known Member

    Messages:
    1,677
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    153
    #8
    The link is being pulled in a cluster of other additions too. So I found the spot in the php where it says include whatever the function is, but when I remove that it also removes other things from the footer that area also being called from this hidden page. So what I did was view source code and then look for the id so I could remove it using my functions page or through css since I couldnt find where it was being called from
     
    locals, Aug 30, 2015 IP
  9. locals

    locals Well-Known Member

    Messages:
    1,677
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    153
    #9
    LOL turdpress is awesome, you just haven't figured out what to use it for
     
    locals, Aug 30, 2015 IP
  10. locals

    locals Well-Known Member

    Messages:
    1,677
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    153
    #10

    Sweet thank you!! I think I saw that inline code somewhere, I will do some more digging
     
    locals, Aug 30, 2015 IP
  11. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,375
    Likes Received:
    1,853
    Best Answers:
    245
    Trophy Points:
    515
    #11
    There's a legitimate use for it other than sleazing out a buggy broken inaccessible train wreck of developer ineptitude that takes advantage of ignorant halfwits not qualified to even HAVE a website in the first place?

    That said, @billzo probably hit it on the head, it's a specificity issue. You should probably use a document inspector like firebug to see if any OTHER ID's in the code are overriding or preventing what you are trying to set directly... or if the turdpress theme is vomiting up multiple instances of the same ID in some form of typical "I can haz intarnets" ineptitude so common to templates not even suited for use in the "dave test".

    With the endless pointless DIV for nothing, classes for nothing, and ID's for nothing thrown at EVERYTHING so common to wordpress templates thanks to the utter and complete ineptitude of the people writing skins for it, such issues on overriding even the simplest of elements is hardly uncommon.

    Remember, a parent ID can trump the element ID... which is why as nonsensical as saying:

    #parentWrapper #myElement { color:#000; }

    Should be, thanks to specificity you do sometimes end up having to say that -- that or you end up resorting to !important. (which you really shouldn't do)

    Specificity -- such a pain in the ass when people start slapping classes and ID's on things for no reason, it damned near needs it's own schoolhouse rock video.
     
    Last edited: Aug 30, 2015
    deathshadow, Aug 30, 2015 IP
  12. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    6,423
    Likes Received:
    1,379
    Best Answers:
    24
    Trophy Points:
    400
    #12
    It should be in the footer. Check it there.
     
    qwikad.com, Aug 30, 2015 IP
  13. COBOLdinosaur

    COBOLdinosaur Active Member

    Messages:
    515
    Likes Received:
    123
    Best Answers:
    11
    Trophy Points:
    95
    #13
    Oh I found a use for it long ago. I use it in courses I teach to demonstrate how hype, adding the word "easy" to ads, and putting a slick marketing wrapper around crap can make junk popular and scam the gullible, ignorant and the lazy. At some point they discover, that every hour they save slopping a site together with WP costs them 10 hours over the lifetime of a site.

    On a professionally developed site following standards and "best practices" written with real coding in instead of a crap collection from theme farms it is a ten second change that gets assigned to part time intern. Instead you end up screwing around for days and require help to implement a change that should be a no-brainer.
     
    COBOLdinosaur, Aug 31, 2015 IP
    deathshadow, billzo and malky66 like this.
  14. billzo

    billzo Well-Known Member

    Messages:
    961
    Likes Received:
    278
    Best Answers:
    15
    Trophy Points:
    113
    #14
    That aptly describes all of Wordpress.

    There are some things that are missing that make you scratch your head. Every little thing you want to do requires a plugin because the developers of Wordpress will not build the functionality in the core. And I'm talking about simple things like being able to input HTML into a post without it being mangled by Wordpress' awful wpauto() function or the javascript/jQuery its TinyMCE editor uses, its almost-as-bad wptexturize() function...and I could go on.

    Wordpress is great for simple blog sites. As a CMS, it is severely lacking in the most basic features. But, I do like its menu system. And I won't mention how ridiculously bloated it is.
     
    billzo, Aug 31, 2015 IP
    deathshadow likes this.