By jason342 on
When I post image links (banner, etc..) in the node (page, story) they images have a ‘line’ under them, almost similar to how hyperlinks have a line under them.
How do I eliminate this please via the CSS?
When I post image links (banner, etc..) in the node (page, story) they images have a ‘line’ under them, almost similar to how hyperlinks have a line under them.
How do I eliminate this please via the CSS?
Comments
This is an 'a' tag issue in
This is an 'a' tag issue in CSS. Most 'a' tags have some sort of line in CSS that reads something like this:
If you want to change all links, then change 'underline' to 'none.' If you want to change image only, then do something like the following:
You might have to flip 'a img' to 'img a'. 'img' is the standard html tag for all images, and 'a' refers to all images that are links.
You can make this change in the drupal.css, but it is better to make it in the css for the theme you are using. drupal.css gets overwritten if you upgrade, but your theme is entirely under your control.
Hope this helps.
Maria
It didn't work, I used both
It didn't work, I used both 'img a' and 'a img', the banner still has an underline.
What I need to point out is the 'underline' is actually attached to the bottom of all link images, rather than being 'under' the image such as your standard hyperlink underlines, which leads me to think this may not be a hyperlink issue.
It may be a border issue, but don't know what to do to eliminate it. But it can’t be that too since I’ve used border: 0px but no use.
Post an URL
Why don't you post an URL so we can have a look at your CSS?
Ok, sorry, here is my
Ok, sorry, here is my CSS.
The problem is dotted lines under the image, notice there is dotted line in the CSS too, but I don't know which is the culprit. I've played around with it, no luck.
I'm using this theme http://themes.drupal.org/node?theme=box_cleanslate
That won't work, because the
That won't work, because the border is applied to the link (
a) not to the image (img). The image is a child of the link, so those border settings surrounds it too.The easiest solution would be to completely disable those dotted borders for node content by removing this line
.main-content .node .content a, .comment .content a, .book .body a { border-bottom: 1px dotted; }Well but maybe you like the look of those dots for Textlinks and actually how really likes easy solutions? ;) They are allways boring, arent they?
> test
So the solution, as most of the time, can be found in a modules which hooks to a specific function - in this case namely the
hook_filter. We need a filter which can find those links containing an image and adds a css-class to it and made them themeable. Well if you think a module/filter is overload for this, you could also add a respective class manually. But as said before, i like the more complicated solutions and just twisted my brain on a lil regular expression, which can do this automatic.Heres the code of the file
imagelinks.module
This has been only tested on "FIltered Html", but i think it will not interfere with other filters. Well at last its very simple.
You ask howto use this for your problem?
greetings
Forget the module idea
Damend, i just clicked on post, when i recognized, this is not really a thing to put in a module. Its totally theme specific, so it should go there.
Nevertheless most of the work has done already by building the regular expression.
the following solution seems to fit semantic better, but could be a lil tiny bit slower because im not sure if the output and so the preg_replace will be cached at this place.
print $contenthope this time i didnt forget anything else :'(
this is an old topic
but it worked. I'm semi-literate to code, but I don't have a clue as to what that gob of php code is doing. reminds me of an htaccess rewrite file.
However, I do know it works and I appreciate the answer. I have sponsor link pages full of images - and have been trying to figure out how to get rid of those lines for over a year.
thanks again.
Thanks StIllE, I took out
Thanks StIllE, I took out the code you mentioned and no more lines, thank you for pointing that out.
I’d be grateful if you looked at this other topic of mine too, and point out the problem there.
http://drupal.org/node/87147
Thanks to all for helping too.