MediaWiki:Common.css
Appearance
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* CSS placed here will be applied to all skins */
/* Infobox styling */
.infobox {
border: 1px solid #a2a9b1;
border-spacing: 3px;
background-color: #f8f9fa;
color: black;
margin: 0.5em 0 0.5em 1em;
padding: 0.2em;
float: right;
clear: right;
font-size: 88%;
line-height: 1.5em;
width: 22em;
}
/* Ensure table takes full width */
.infobox tbody,
.infobox tr {
width: 100%;
display: table;
table-layout: fixed;
}
.infobox-title {
font-size: 125%;
font-weight: bold;
text-align: center;
background-color: ;
padding: 0.2em;
}
.infobox-above {
font-size: 110%;
text-align: center;
background-color: #e6e6e6;
padding: 0.2em;
}
.infobox-image {
text-align: center;
padding: 0.2em;
}
.infobox th {
vertical-align: top;
white-space: nowrap;
text-align: left;
padding: 0.2em 0.4em;
background-color: transparent;
width: 35%;
overflow: hidden;
text-overflow: ellipsis;
}
.infobox td {
vertical-align: top;
padding: 0.2em 0.4em;
width: 65%;
word-wrap: break-word;
}
.infobox-header {
text-align: center;
background-color: ;
font-weight: bold;
padding: 0.2em;
}
.infobox-below {
text-align: center;
background-color: #e6e6e6;
padding: 0.2em;
}
/* URL template styling */
.url {
word-wrap: break-word;
word-break: break-all;
}
/* Code template styling */
code {
background-color: #f6f6f6;
border: 1px solid #ddd;
border-radius: 3px;
padding: 1px 4px;
font-family: Consolas, Monaco, 'Courier New', monospace;
font-size: 90%;
white-space: pre-wrap;
word-wrap: break-word;
}
.shortdescription {
display: block;
font-size: 90%;
color: #54595d;
font-style: italic;
margin-top: -0.5em;
margin-bottom: 1em;
line-height: 1.4;
}
/* Change the color of User:Shaunak Chakraborty page title to blue */
.page-User_Shaunak_Chakraborty #firstHeading {
color: blue;
}
/* Alternative: Use a specific shade of blue */
.page-User_Shaunak_Chakraborty #firstHeading {
color: #0645ad; /* Wikipedia's default link blue */
}
/* Alternative: Use a darker blue */
.page-User_Shaunak_Chakraborty #firstHeading {
color: #00008B; /* Dark blue */
}
/* Alternative: Use a lighter blue */
.page-User_Shaunak_Chakraborty #firstHeading {
color: #1E90FF; /* Dodger blue */
}
/* Mobile responsiveness */
@media screen and (max-width: 640px) {
.infobox {
width: 100% !important;
max-width: 100% !important;
margin: 0.5em 0 !important;
float: none !important;
clear: both !important;
display: block !important;
box-sizing: border-box !important;
}
/* Ensure table elements take full width on mobile */
.infobox tbody,
.infobox tr {
width: 100% !important;
display: table !important;
table-layout: fixed !important;
}
.infobox th {
width: 35% !important;
white-space: nowrap !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
}
.infobox td {
width: 65% !important;
word-wrap: break-word !important;
}
}
/* Tablet responsiveness */
@media screen and (max-width: 768px) {
.infobox {
width: 100%;
margin: 0.5em 0;
float: none;
clear: both;
}
.infobox tbody,
.infobox tr {
width: 100%;
display: table;
table-layout: fixed;
}
}
/* --- Custom Sitenotice Styles --- */
/* * 1. Positioning and General Appearance
* This uses fixed positioning to place it at the very top of the viewport,
* ensuring it's above the page title and content.
*/
.custom-sitenotice {
/* Fixed to the viewport, above everything else */
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1000; /* Ensure it is above all other content/headers */
/* Appearance */
background-color: #ffcccc; /* Light red/warning color */
border-bottom: 1px solid #cc0000;
padding: 8px 15px;
box-sizing: border-box; /* Include padding/border in the width */
color: #333;
font-size: 0.95em;
text-align: center;
line-height: 1.4;
}
/* * 2. Layout for Content and Dismiss button
*/
.custom-sitenotice-content {
display: inline-block;
padding-right: 15px; /* Space between message and dismiss button */
}
.custom-sitenotice-dismiss {
display: inline-block;
position: absolute; /* Position relative to the parent .custom-sitenotice */
right: 15px;
top: 50%;
transform: translateY(-50%); /* Vertically center the button */
}
/* Style for the dismiss link */
.custom-sitenotice-dismiss a {
color: #cc0000;
text-decoration: none;
font-weight: bold;
font-family: sans-serif;
}
.custom-sitenotice-dismiss a:hover {
text-decoration: underline;
color: #800000;
}
/* * 3. Adjusting the main page content
* This is crucial to prevent the sitenotice from overlapping the content
* and to remove the "empty line" problem. This pushes the main site wrapper
* down by the height of the notice. You may need to adjust the value (e.g., 40px)
* if your notice is taller.
*/
#mw-body, #content {
margin-top: 40px; /* Adjust this to the height of your notice */
}
/*
* 4. Mobile Responsiveness (Optional but recommended)
* Stack the content and dismiss button if needed.
*/
@media screen and (max-width: 768px) {
.custom-sitenotice {
/* Remove fixed positioning for mobile to prevent covering too much screen */
position: static;
}
/* Make the content take full width */
.custom-sitenotice-content {
display: block;
padding-right: 0;
margin-bottom: 5px;
}
/* Move the dismiss button to the bottom center for easy tapping */
.custom-sitenotice-dismiss {
position: static;
display: block;
transform: none;
margin-top: 5px;
text-align: center;
}
/* Remove the margin adjustment for mobile, as we switched to static position */
#mw-body, #content {
margin-top: 0 !important;
}
}