MediaWiki:Common.css: Difference between revisions

From Amberlynn Wiki
Jump to navigation Jump to search
Created page with "CSS placed here will be applied to all skins: <div class="responsive-table"> {| class="wikitable" style="display: flex; flex-wrap: wrap; width: 100%;" |- | Cell 1 || Cell 2 || Cell 3 || Cell 4 || Cell 5 || Cell 6 |} </div> <style> .responsive-table table { border-collapse: collapse; } .responsive-table td { border: 1px solid black; padding: 8px; flex: 1 1 16.66%; Each cell takes ~1/6th of the width initially: box-sizing: border-box; } /* M..."
 
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* CSS placed here will be applied to all skins */
.welcome-table {
<div class="responsive-table">
    background-color: #f5f5f5;    /* Very light grey background */
{| class="wikitable" style="display: flex; flex-wrap: wrap; width: 100%;"
    border: 1px solid #808080;    /* Solid grey border */
|-
    border-collapse: collapse;
| Cell 1 || Cell 2 || Cell 3 || Cell 4 || Cell 5 || Cell 6
}
|}
 
</div>
/* Center content in table cells */
.welcome-table td {
    vertical-align: top;
    text-align: center; /* Center the text under the image */
    padding: 8px; /* Add some padding for spacing */
}
 
.welcome-table th {
    padding-top: 8px;         /* Increased padding on top for header cells */
}
 
/* Ensure images scale properly */
.eras-table img {
    max-width: 200px;
    width: 100%;
    height: auto;
    display: block; /* Ensure image behaves as a block for centering */
    margin: 0 auto; /* Center the image horizontally */
}


<style>
/* Base table styling */
.responsive-table table {
.eras-table {
     border-collapse: collapse;
     border-collapse: collapse;
    width: 100%;
    table-layout: fixed; /* Helps maintain column widths */
}
}
.responsive-table td {
 
     border: 1px solid black;
/* Ensure header spans all columns */
     padding: 8px;
.eras-table th {
     flex: 1 1 16.66%; /* Each cell takes ~1/6th of the width initially */
     width: 100%;
    box-sizing: border-box;
     display: table-cell; /* Keep table behavior for spanning */
     text-align: center; /* Center the title text */
}
}


/* Medium resolution/zoom: 3 columns, 2 rows */
/* Center content in table cells */
@media (max-width: 800px) {
.eras-table td {
     .responsive-table td {
     vertical-align: top;
        flex: 1 1 33.33%; /* Each cell takes ~1/3rd of the width */
    text-align: center; /* Center the text under the image */
     }
     padding: 10px; /* Add some padding for spacing */
}
}


/* Small resolution/max zoom: 1 column, 6 rows */
/* Medium screens and below - switch to 3x2 layout for content */
@media (max-width: 400px) {
@media screen and (max-width: 800px) {
     .responsive-table td {
     .eras-table {
         flex: 1 1 100%; /* Each cell takes full width */
        display: block; /* Switch to block for responsive layout */
    }
    .eras-table thead {
        display: block; /* Ensure header stays separate */
    }
    .eras-table th {
         display: block; /* Full width block for header */
        width: 100%; /* Explicitly full width */
    }
    .eras-table tbody {
        display: flex;
        flex-wrap: wrap;
    }
    .eras-table tr {
        display: contents; /* Let cells flow into flex */
    }
    .eras-table td {
        flex: 0 0 33.333%; /* 3 columns */
        box-sizing: border-box;
        text-align: center; /* Ensure text stays centered in flex layout */
        padding: 10px;
     }
     }
}
}
</style>

Latest revision as of 13:08, 27 February 2025

.welcome-table {
    background-color: #f5f5f5;    /* Very light grey background */
    border: 1px solid #808080;    /* Solid grey border */
    border-collapse: collapse;
}

/* Center content in table cells */
.welcome-table td {
    vertical-align: top;
    text-align: center; /* Center the text under the image */
    padding: 8px; /* Add some padding for spacing */
}

.welcome-table th {
    padding-top: 8px;          /* Increased padding on top for header cells */
}

/* Ensure images scale properly */
.eras-table img {
    max-width: 200px;
    width: 100%;
    height: auto;
    display: block; /* Ensure image behaves as a block for centering */
    margin: 0 auto; /* Center the image horizontally */
}

/* Base table styling */
.eras-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed; /* Helps maintain column widths */
}

/* Ensure header spans all columns */
.eras-table th {
    width: 100%;
    display: table-cell; /* Keep table behavior for spanning */
    text-align: center; /* Center the title text */
}

/* Center content in table cells */
.eras-table td {
    vertical-align: top;
    text-align: center; /* Center the text under the image */
    padding: 10px; /* Add some padding for spacing */
}

/* Medium screens and below - switch to 3x2 layout for content */
@media screen and (max-width: 800px) {
    .eras-table {
        display: block; /* Switch to block for responsive layout */
    }
    .eras-table thead {
        display: block; /* Ensure header stays separate */
    }
    .eras-table th {
        display: block; /* Full width block for header */
        width: 100%; /* Explicitly full width */
    }
    .eras-table tbody {
        display: flex;
        flex-wrap: wrap;
    }
    .eras-table tr {
        display: contents; /* Let cells flow into flex */
    }
    .eras-table td {
        flex: 0 0 33.333%; /* 3 columns */
        box-sizing: border-box;
        text-align: center; /* Ensure text stays centered in flex layout */
        padding: 10px;
    }
}