r/csshelp • • Dec 31 '20

OldReddit css styleSheet help

i have no understanding of css and i would like for there to be a rectangle with text and a link at the top of my subreddit, does anyone know how to do this or if its even possible? below the menu but above all the posts.

9 Upvotes

7 comments sorted by

3

u/[deleted] Jan 01 '21

[removed] — view removed comment

3

u/dragonpro9827 Jan 01 '21

yes!

1

u/dragonpro9827 Jan 01 '21

/r/counting at the top you can see that they have a square with text,

1

u/Block_Parser Jan 01 '21
#siteTable:before {
    content: 'Your Text Here';
    display: block;
    width: calc(100% - 346px);
    background-color: lightslategrey;
    border: 1px solid black;
    color: white;
    font-size: 1.5em;
    padding: 15px 20px;
    margin-bottom: 5px;
}

Will give you something similar. On /r/counting they are moving part of the sidebar to the top, that is a bit more complicated, but if you just need text this should work for you.

1

u/dragonpro9827 Jan 01 '21

do you know how to move a part of the sidebar because there isn't a way to make links with CSS

1

u/Block_Parser Jan 02 '21

You'll need to add some padding-bottom to your #siteTable:before to fit it, maybe

padding: 15px 20px 30px;

Then you can move it with position absolute.

.usertext-body > .md > p:first-child {
    position: absolute;
    top: 170px;
    left: 25px;
    color: #fff;
}