|
|
| (14 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| // Create a new <style> element
| |
| var customStyle = document.createElement("style");
| |
| customStyle.innerHTML = `
| |
| /* Change background color */
| |
| body {
| |
| background-color: #f4f4f4 !important;
| |
| }
| |
|
| |
|
| /* Customize the sidebar */
| |
| #mw-panel {
| |
| background: #333 !important;
| |
| color: white !important;
| |
| }
| |
|
| |
| #mw-panel a {
| |
| color: #ffcc00 !important;
| |
| }
| |
|
| |
| /* Change the font of the content */
| |
| #mw-content-text {
| |
| font-family: Arial, sans-serif !important;
| |
| font-size: 16px !important;
| |
| }
| |
|
| |
| /* Hide the "edit" button */
| |
| .mw-editsection {
| |
| display: none !important;
| |
| }
| |
|
| |
| /* Improve tables */
| |
| table.wikitable {
| |
| border-collapse: collapse !important;
| |
| border: 2px solid #444 !important;
| |
| background-color: #fff !important;
| |
| }
| |
|
| |
| table.wikitable th {
| |
| background-color: #333 !important;
| |
| color: white !important;
| |
| padding: 8px !important;
| |
| }
| |
|
| |
| table.wikitable td {
| |
| padding: 6px !important;
| |
| }
| |
|
| |
| /* Highlight links on hover */
| |
| a:hover {
| |
| color: red !important;
| |
| text-decoration: underline !important;
| |
| }
| |
| `;
| |
|
| |
| // Append the <style> element to the document head
| |
| document.head.appendChild(customStyle);
| |
| alert("Custom CSS applied via JavaScript!");
| |