r/csshelp • • Oct 13 '14

Need help making banner text clickable

http://www.reddit.com/r/Sephina/

Hello! I would like the text area in my banner clickable to redirect to the subreddit. Could anyone please help me out? I am not CSS savvy.

Thank you all so kindly in advance.

6 Upvotes

6 comments sorted by

3

u/gavin19 Oct 13 '14

You can use

.pagename a:after {
    position: absolute;
    top: 40px;
    left: 140px;
    height: 30px;
    width: 560px;
    content: '';
}

to extend the existing subreddit link to cover that part of the header.

1

u/Askaj Oct 13 '14

Hey im trying to use the same code for my sub, but it doesn't seem to work properly, it somehow mixes up with the threads.

3

u/gavin19 Oct 13 '14

It's won't work on every sub if you just use it as is. It's dependent on the subreddit layout and what styles you've already applied. Yours is different so you need to use

.pagename a:after {
    position: absolute;
    top: -60px;
    left: 0;
    height: 65px;
    width: 290px;
    content: '';
}

1

u/Askaj Oct 13 '14

That's great, thanks again :)!

0

u/[deleted] Oct 13 '14

[deleted]

2

u/gavin19 Oct 13 '14

Yes. Use the subreddit link that reddit supplies you in the header and put the image into that. The CSS you need depends on the image dimensions and the height of the header but the gist would be

.pagename a {
    position: absolute;
    top: 19px;
    right: 0;
    bottom: 0;
    left: 0;
    text-indent: -999em;
    background: url(%%img%%);
}
#header-img {
    position: relative;
    z-index: 1;
}