The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

About code boxes

3 posters

Go down

Solved About code boxes

Post by Winging April 18th 2023, 9:56 am

Forum version : #ModernBB
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : Yourself
Forum link :https://ekin-ek.666forum.com
- - - - - - - -
Hello!

I changed my code box style,and found small problems.
I don't want gray blocks.
And 【< >】appearing on the far right, some words that block the top.

About code boxes Ee10

I want to be able to be clean like the picture (no overlap)
About code boxes Ee11


And My code

In CSS:
Code:
/* codebox 代碼框 */
.codebox dd {
  background-color: #cdfaf5;
  border-radius: 3px;
}
.codebox dt {
  background-color: #73d9ce;
  border-radius: 3px;
}
.selectCode { float:right; text-transform: uppercase; cursor:pointer;
}
div.cont_code { clear: right;
}

In Javascript ( In all the pages):
Code:
function selectCode(e) {
        var doc = document
            , text = $(e).closest("dl").find(".cont_code,code").get(0)
            , range, selection
        ;
        if (doc.body.createTextRange) {
            range = document.body.createTextRange();
            range.moveToElementText(text);
            range.select();
        } else if (window.getSelection) {
            selection = window.getSelection();       
            range = document.createRange();
            range.selectNodeContents(text);
            selection.removeAllRanges();
            selection.addRange(range);
        }
    };
    $(function(){$("dl.codebox:not(.spoiler,.hidecode)  > dd.code, dl.codebox:not(.spoiler,.hidecode)  > dd > code").closest("dl").find('dt').append('<span onClick="selectCode(this)" class="selectCode">選擇內容</span>')});


Thanks in advance for your help!


Last edited by Winging on April 18th 2023, 10:16 am; edited 1 time in total
Winging
Winging
Forumember

Female Posts : 149
Reputation : 4
Language : traditional chinese

https://ekin-ek.666forum.com/

Back to top Go down

Solved Re: About code boxes

Post by Razor12345 April 18th 2023, 10:03 am

Good afternoon!

AP - Display - Colors&CSS - Stylesheet CSS

Try this code:

Code:
dl.codebox {
  background-color: transparent;
  border-color: transparent;
}

dl.codebox:before {
  display: none;
}

Result:

About code boxes Scree105


Last edited by Razor12345 on April 18th 2023, 10:09 am; edited 1 time in total (Reason for editing : Correct code)
Razor12345
Razor12345
Support Moderator
Support Moderator

Male Posts : 1575
Reputation : 266
Language : Ukr, Rus, Eng
Location : Ukraine

SarkZKalie and Winging like this post

Back to top Go down

Solved Re: About code boxes

Post by Winging April 18th 2023, 10:10 am

thank you @Razor12345

oh yes it works!it gets very clean!

About code boxes Eeaa11

Thank you very much! About code boxes 1f60a
Winging
Winging
Forumember

Female Posts : 149
Reputation : 4
Language : traditional chinese

https://ekin-ek.666forum.com/

Back to top Go down

Solved Re: About code boxes

Post by Ape April 18th 2023, 3:27 pm

Thank you for your help @Razor12345
Problem solved & topic archived.
Please read our forum rules: ESF General Rules


About code boxes Left1212About code boxes Center11About code boxes Right112
About code boxes Ape_b110
About code boxes Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19325
Reputation : 2005
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Razor12345 likes this post

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum