Vert/Horiz Centering an Image with a little Text

I have a little webpage I created on the free site NEKOWEB and I can’t figure out how to perfectly center — vertically and horizontally — my little avatar and some text below it. I’m not good with Flex (as everyone here knows heh) and I have a suspicion this is Flex territory (?). Or grid (?).

But I have to explain something about my avatar: I center it on the nose, not the dimensions of his enclosing block. That’s all been accounted for in the graphic I uploaded so that centering his enclosing box will center on his nose.

Except of course it doesn’t. It neither centers horizontally or vertically. The only text as you can see is my name semicodin and “Click.” I want the graphic clickable to a Table of Contents which we can call toc.html. Thanks for your help. :biggrin:

<!DOCTYPE html>
<HTML LANG="en">
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="preconnect" href="https://fonts.googleapis.com"> 
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Crete+Round:ital@0;1&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Calistoga&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Solway:wght@300;400;500;700;800&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Henny+Penny&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Special+Elite&display=swap" rel="stylesheet">

<title>Semicodin&rsquo;s Pages &#47; View my Posts on sitepoint.com &#47; &#7172; I&rsquo;m Learnin&tsquo; HTML!</title>

<style>

body {
    font-family: 'courier prime', monospace;
    text-align: center;
    font-size: .75rem;
    line-height: 1rem;
    font-weight: bold;
    color: #888888;
    background-color: #fff8e7;  /* ivory */
}

.pic {
    width: auto;
    margin-left: auto;
    margin-right: auto;
    display: block;
}
.henpen {
    color: black;
    text-align: center;
    margin-top: 1.25rem;
    font-size: 2.25rem;
    line-height: 1.02;
    font-weight: 700;
    font-family: 'Henny Penny', cursive;
}

</style>
</head>

<body>
<div class="pic">
    <a href="https://semicodin.nekoweb.org/toc.html"><img src="https://lh3.googleusercontent.com/pw/AP1GczNz-WYl1gBi6n81m3gUUWXDq382BLM7vRiZ8g1wcf8vbFO3f33pL7FMXZpXvhp_V2nyjK9--AhTUIRQuYABktqC_n2HprLmLGHvhGCGqLfv5-eprg" width="220" height="220" alt=""></a>
</div>

<div class="henpen">semicodin</div>
Click.

</body>
</html>

The code above isn’t on the page you linked ot. Could you update the link?

1 Like

Hi Ralph. :biggrin: I haven’t uploaded it yet because I wanted to get it working first. I think I just caught my horizontal centering error (width: auto).

So I wanted to get vertical working. And Ralph, for some reason the link is spilling over to the two lines below the graphic, which I didn’t want. I only wanted the graphic to be clickable.

Centered content:-

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="preconnect" href="https://fonts.googleapis.com"> 
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Henny+Penny&display=swap" rel="stylesheet">

<title>Semicodin&rsquo;s Pages &#47; View my Posts on sitepoint.com &#47; &#7172; I&rsquo;m Learnin&tsquo; HTML!</title>

<style media="screen">
html,body {
    height: 100%;
    margin: 0;
}
body {
    font-family: 'courier prime', monospace;
    font-size: .75rem;
    line-height: 1rem;
    font-weight: bold;
    color: #888888;
    background-color: #fff8e7;  /* ivory */
    display:flex;
    flex-direction:column;
    align-items: center;
    justify-content: center;
}
.henpen {
    color: black;
    margin-top: 1.25rem;
    font-size: 2.25rem;
    line-height: 1.02;
    font-weight: 700;
    font-family: 'Henny Penny', cursive;
}
</style>

</head>

<body>

<a href="https://semicodin.nekoweb.org/toc.html">
 <img src="https://lh3.googleusercontent.com/pw/AP1GczNz-WYl1gBi6n81m3gUUWXDq382BLM7vRiZ8g1wcf8vbFO3f33pL7FMXZpXvhp_V2nyjK9--AhTUIRQuYABktqC_n2HprLmLGHvhGCGqLfv5-eprg" alt="My avatar">
</a>

<div class="henpen">semicodin</div>

<span>Click.</span>

</body>
</html>
1 Like

Snady! I missed you. Thank you; this works perfectly. :biggrin:

So I was looking at adding a page counter to my little site and found a free one here. It only counts up to 200 but that’s alright because I doubt I’d have more than 200 visitors. Mostly I want to get comfortable with it. Years ago I had a buddy build a Php counter for me but it wasn’t as sophisticated as the ones today. Oddly enough I took to Php almost overnight and was comfortable editing it.

@snadyleiby, could we add this so that it shows up at the bottom of the page you just did? Here is the code I’m supposed to insert to my page:

<script src="https://static.elfsight.com/platform/platform.js" data-use-service-core defer></script>
<div class="elfsight-app-38d2e293-6181-4cee-924c-6395321646d9" data-elfsight-app-lazy></div>

Like this perhaps…

<!DOCTYPE html>
<html lang="en">
<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="preconnect" href="https://fonts.googleapis.com"> 
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Henny+Penny&display=swap" rel="stylesheet">

<title>Semicodin&rsquo;s Pages &#47; View my Posts on sitepoint.com &#47; &#7172; I&rsquo;m Learnin&tsquo; HTML!</title>

<style media="screen">
html,body {
    height: 100%;
    margin: 0;
}
body {
    font-family: 'courier prime', monospace;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: bold;
    color: #888888;
    background-color: #fff8e7;  /* ivory */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.henpen {
    color: black;
    margin-top: 1.25rem;
    font-size: 2.25rem;
    line-height: 1.02;
    font-weight: 700;
    font-family: 'Henny Penny', cursive;
}

#counter {
    position: absolute;
    bottom: 0;
    max-width: 100%;
}
</style>

</head>

<body>

<a href="https://semicodin.nekoweb.org/toc.html">
 <img src="https://lh3.googleusercontent.com/pw/AP1GczNz-WYl1gBi6n81m3gUUWXDq382BLM7vRiZ8g1wcf8vbFO3f33pL7FMXZpXvhp_V2nyjK9--AhTUIRQuYABktqC_n2HprLmLGHvhGCGqLfv5-eprg" alt="My avatar">
</a>

<div class="henpen">semicodin</div>

<span>Click.</span>

<div id="counter" class="elfsight-app-38d2e293-6181-4cee-924c-6395321646d9" data-elfsight-app-lazy></div>

<script src="https://static.elfsight.com/platform/platform.js" data-use-service-core defer></script>

</body>
</html>
1 Like

It may be of no importance to you, but I have
just noticed that your chosen ‘page counter’
does not work in my Vivaldi 6.7.3329.39 test
browser at present. It could be possible that it
may not work in other browsers in the future.

Further reading
https://chromestatus.com/feature/5083947249172480

You may wish to contact elfsight about this.

1 Like

Edit: it looks like the counter reset, no big deal. It looks great.

Snady! I got 42 page hits! Jesus. 10 of them are mine but still . . . 32 views when I only just opened the damn thing.

It’s perfect and you are a genius my friend. Absolute genius (speaking of absolute).

About browsers . . . I too use Vivaldi browser (isn’t it great?) but I’m of course on my pathetic SmartPhone using their Android App version. Anyway mine works perfectly. Uploading it now . . .

You should bear in mind that most of that number
were run up during my page testing, :rofl:

2 Likes

Alright guy all fun aside . . . I’m using a different counter (from hiStats, still free but much more data without a 200 visit cap and up to 300 sites for free account come-to-daddy) but I want the little box to display in the center at the bottom of the page.

Actually anybody could help me with this . . .

I thought I’d better check in with you first because of that absolute in your counter code that I borrowed from the other page you did for me. (((Paging @snadyleiby))) Get back in the house man I know you’re out there somewhere hiking. :biggrin:

Here is a severely-shortened toc. Do you see how the counter is riding up overlapping the main content? That’s supposed to be at the bottom of the page (shoot none of it shows). So I want it at the bottom of the page and centered. Any ideas how I can get this counter working? By the way, their code is rife with errors tsk. :nono: I’m afraid to touch it though.

<!DOCTYPE html>
<HTML LANG="en">
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="preconnect" href="https://fonts.googleapis.com"> 
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Crete+Round:ital@0;1&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Calistoga&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Solway:wght@300;400;500;700;800&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Henny+Penny&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Special+Elite&display=swap" rel="stylesheet">

<title>TABLE OF CONTENTS &#7172; semicodin</title>

<style>

body {
    width: 1080px;
    background-color: black;
    margin: 0;
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}

#counter {
    position: absolute;
    bottom: 0;
    max-width: 100%;
}

.ssz1 {
    margin-top: 3.13rem;
    text-align: center;
    font-family: 'crete round';
    font-size: 2rem;
    line-height: 2.25rem;
    font-weight: bold;
    color: #ebf6ff;   /* PALE BLUE */
}
.ssz2 {
    text-align: center;
    margin-bottom: 1.75rem;
    font-family: 'crete round';
    font-size: 1.75rem;
    line-height: 2rem;
    font-weight: bold;
    color: #ebf6ff;   /* PALE BLUE */
}

.henpen {
    text-align: center;
    color: #ffffee;   /* ivory */
    margin: 2.5rem 16% 0rem 16%;
    font-size: 3.75rem;
    line-height: 3.88;
    font-weight: 700;
    font-family: 'Henny Penny', cursive;
}

.thanks {
    margin: 2.5rem 15% 6.25rem 15%;
    color: #ffffee;   /* ivory */
    text-align: center;
    font-style: italic;
    font-family: 'crete round', serif;
    font-size: 2.25rem;
    line-height: 2.38rem;
    font-weight: bold;
}
.hilite {
    margin: 2rem 2.94rem 1rem 2.94rem;
    text-align: center;
    font-style: italic;
    color: black;
    background-color: white;
    font-family: 'crete round', serif;
    font-size: 2.25rem;
    line-height: 2.38rem;
    font-weight: bold;
}

td {
    padding-top: .4rem;
    padding-right: .4rem;
    padding-bottom: .4rem;
    padding-left: .7rem;
}
.design1 {
    width: 88%;          /*    DESCRIPTION    */
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.here {
    color: #888888;
    font-family: 'roboto slab', serif;
    font-weight: 400;
	font-size: 2.5rem;
    line-height: 2.63rem;
}

/* ━━━━━━━━ TABLE 2 ━━━━━━━━ */
.table2 th {
    border-bottom: 1.75rem groove #bbac86;    /* mushrooms */
    width: auto;
    color: #ffffee;        /* ivory */
    text-align: center;
    font-style: italic;
    background-color: black;
    font-family: 'crete round', serif;
    font-size: 4rem;
    line-height: 4.25rem;
    font-weight: bold;
}
.group2 {          /*   CLASS LETTER (A-E)    */
    width: 8%;
    font-family: 'calistoga', serif;
    font-weight: 400;
	font-size: 2.75rem;
    line-height: 2.88rem;
    color: blue;
}
.design2 {
    width: 88%;          /*    DESCRIPTION    */
    color: blue;
    font-family: 'calistoga', serif;
    font-weight: 400;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.table2 {
    width: auto;
    margin: 2.25rem 9% 0rem 9%;
    border-top: 1.75rem groove #bbac86;    /* mushrooms */
    border-left: 1.75rem groove #bbac86;    /* mushrooms */
    border-right: 1.75rem groove #bbac86;    /* mushrooms */
    border-collapse: collapse;
    font-family: 'roboto slab', serif;
    font-size: 2.25rem;
    line-height: 2.31rem;
    font-weight: bold;
    color: black;
}
.table2 tbody tr:nth-child( odd ) {
    background-color:  white;
}
.table2 tbody tr:nth-child( even ) {
    background-color: #ebf6ff;   /* PALE BLUE */
}
.table2 tbody tr td:nth-of-type(1) {
    border-right: .19rem solid black;
    text-align: center;
}
.table2 tbody tr td:nth-of-type(2) {
    border-right: .19rem solid black;
    text-align: left;
}
/* ━━━━━━━━ TABLE 3 ━━━━━━━━ */
.group3 {  /* CLASS LETTER (A-E) */
    width: 8%;
    font-family: 'calistoga', serif;
    font-weight: 400;
	font-size: 2.75rem;
    line-height: 2.88rem;
    color: green;
}
.design3 {
    width: 88%;  /* DESCRIPTION */
    color: green;
    font-family: 'calistoga', serif;
    font-weight: 400;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.table3 {
    width: auto;
    margin: 0rem 9% 1.25rem 9%;
    border-bottom: 1.75rem groove #bbac86;    /* mushrooms */
    border-right: 1.75rem groove #bbac86;    /* mushrooms */
    border-left: 1.75rem groove #bbac86;    /* mushrooms */
    border-collapse: collapse;
    font-family: 'roboto slab', serif;
    font-size: 2.25rem;
    line-height: 2.31rem;
    font-weight: bold;
    color: black;
}
.table3 tbody tr:nth-child( odd ) {
    background-color:  white;
}
.table3 tbody tr:nth-child( even ) {
    background-color: #f3ffeb;  /* PALE GREEN */
}
.table3 tbody tr td:nth-of-type(1) {
    border-right: .19rem solid black;
    text-align: center;
}
.table3 tbody tr td:nth-of-type(2) {
    border-right: .19rem solid black;
    text-align: left;
}
/* ━━━━━━━━━━ COLORS ━━━━━━━━━━━ */

.ivory {
    color: #ffffee;
    text-align: center;
    margin: 2.25rem 0rem 2.25rem 0rem;
}
.blu {color: blue}
.blub {color: blue; font-weight: bold;}
.fusch {color: #ca009b}
.fuschb {color: #ca009b; font-weight: bold}
.fuschi {color: #ca009b; font-style: italic}
.crim {color: crimson}
.crimb {color: crimson; font-weight: bold}
.crimi {color: crimson; font-style: italic}
.grey {color: grey}
.green {color: #248900}  /* green */
.greenb {color: #248900; font-weight: bold}

/* ━━━━━━━━━ LINKS ━━━━━━━━━━━ */

a:active {color: crimson}
a:hover {color: crimson}
a:link {color: blue}
a:visited {color: blue}

.redlink a:link {color: crimson}
.redlink a:visited {color: crimson}

.whlink a:link {color: #ffffee}  /* ivory */
.whlink a:visited {color: #ffffee}  /* ivory */

.bk1link a:link {
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.bk1link a:visited {
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.bk2link a:link {
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.bk2link a:visited {
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.bnlink a:link {
      padding-bottom: 10px;
      color: #bbac86;    /*  BROWN  */
      background: black;
      text-align: center;
      font-style: italic;
      font-family: 'roboto condensed', sans-serif;
      font-size: 1.88rem;
      line-height: 2rem;
      font-weight: 700;
}
.bnlink a:visited {
      padding-bottom: 10px;
      color: #bbac86;    /*  BROWN  */
      background: black;
      text-align: center;
      font-style: italic;
      font-family: 'roboto condensed', sans-serif;
      font-size: 1.88rem;
      line-height: 2rem;
      font-weight: 700;
}

/* ━━━━━━ MISCELLANEOUS ━━━━━━━ */

.ctr {text-align: center}
.undr {text-decoration: underline}

.clamwh {
	color: #ffffee;   /* IVORY */
	font-style: italic;
	font-family: roboto, sans-serif;
    font-size: 2.69rem;
    font-weight: 900;
}
.clambu {
	color: #ebf6ff;   /* PALE BLUE */
	font-style: italic;
	font-family: roboto, sans-serif;
    font-size: 2.69rem;
    font-weight: 900;
}
.clambk {
	color: black;
	font-style: italic;
	font-family: roboto, sans-serif;
    font-size: 2.69rem;
    font-weight: 900;
}
.clamcr {
	color: crimson;
	font-style: italic;
	font-family: roboto, sans-serif;
    font-size: 2.69rem;
    font-weight: 900;
}
.clambu {
	color: blue;
	font-style: italic;
	font-family: roboto, sans-serif;
    font-size: 2.69rem;
    font-weight: 900;
}
/* ━━━━━━━━━ END CSS ━━━━━━━━━━ */

</style>
</head>

<body>

<div class="ssz1">
This Is A Small Screen Zone*</div>
<div class="ssz2">
*Designed and built for SmartPhones<span class="clamlbu">!</span></div>

<table class="table2">
        <thead>
<tr>
<th colspan="2">Table of Contents</th>
                </tr>
        </thead>
<tbody>

<tr>
        <td class="group2"></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/index.html" target="_blank">Home</a></span>
        </td>
        </tr>
<tr>
        <td class="group2"></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/about.html" target="_blank">About</a></span></td>
        </tr>
<tr>
        <td class="group2"></td>
        <td class="design1">
Table of Contents <span class="here">(You Are Here)</span></td>
        </tr>
<tr>
        <td class="group2"></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/#_THRU_J/shout_ellipse_01.html" target="_blank">&lt;shape-outside: ellipse&gt;</a></span></td>
        </tr>
<tr>
        <td class="group2"></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/#_THRU_J/shout_polygon_01.html" target="_blank">&lt;shape-outside: polygon&gt;</a></span></td>
        </tr>
<tr>
        <td></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/K_THRU_Z/uspspod01.html" target="_blank">Complex Business Letter</a></span> Form for 2 Addressees w&#47;USPS P.O.D. Counter Roll Sticker Positions
</td>
        </tr>

<tr>
        <td></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/K_THRU_Z/rem_conversion_chart.html" target="_blank">REM Conversion Chart</a></span> Flex w&#47;nth Child</td>
        </tr>

<tr>
        <td class="group2"></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/K_THRU_Z/vert_center_image_w_text.html" target="_blank">Vertically Center an Image</a></span> &amp; Horizntly Including Text w&#47;Page Counter Footer</td>
        </tr>
<tr>
        <td class="group2">A.</td>
        <td class="design2">CSS &mdash; PARCHMENT w&#47;BORDER</td>
        </tr>
<tr>
        <td></td>
        <td>1 TAB CSSPAR1 &mdash; Coming Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>1 TAB CSSPAR1_ANI &#47; ANIMATED &mdash; Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>2 TABS CSSPAR2 &mdash; Coming Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>2 TABS CSSPAR_ANI &#47; ANIMATED &mdash; Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>3 TABS CSSPAR3 &mdash; Coming Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>3 TABS CSSPAR3_ANI &#47; ANIMATED &mdash; Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>7 TABS CSSPAR7 &mdash; Coming Soon!</td>
        </tr>
</tbody>
</table>

<div class="ivory">
Got Questions? You can PM me at<br>
<span class="whlink">
<a href="https://sitepoint.com/community/u/semicodin/activity">the Sitepoint Forums</a></span><span class="clamwh">!</span>
<br>
<br>
</div>
<div class="thanks">
The author would also like to thank the fine artists at Inkscape Forum for their valuable contribution in rendering
<br>
<span class="hilite">&nbsp;3 very clean&nbsp;</span>
<br>
masters of the tabs in SVG, most especially &ldquo;polygon&rdquo; and &ldquo;tyler&rdquo;. You guys are the best! Until we meet again&nbsp;.&nbsp;.&nbsp;.
</div>


<div id="counter">
<!-- Histats.com  START (html only)-->
<a href="/" alt="page hit counter" target="_blank" >
<embed src="//s10.histats.com/430.swf"  flashvars="jver=1&acsid=4873214&domi=4"  quality="high"  width="112" height="75" name="430.swf"  align="middle" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" wmode="transparent"></a>
<img  src="//sstatic1.histats.com/0.gif?4873214&101" alt="html hit counter" border="0">
<!-- Histats.com  END  -->
</div>

</body>
</html>

To put this

<div id="counter">`

at the bottom of the page remove this…

#counter {
   position: absolute;
   bottom: 0;
   max-width: 100%;
}

…as it is already there. :rofl:

I have just noticed that on your actual page…

https://semicodin.nekoweb.org/toc.html

…you do not have…

<div id="counter">

… so the problem does not exist.

1 Like

If I gave you the wrong one I apologize. Here is the correct one. Is max-width: 100%; intended to center the text?

<!DOCTYPE html>
<HTML LANG="en">
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="preconnect" href="https://fonts.googleapis.com"> 
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Crete+Round:ital@0;1&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Calistoga&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Solway:wght@300;400;500;700;800&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Henny+Penny&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Special+Elite&display=swap" rel="stylesheet">

<title>TABLE OF CONTENTS &#7172; semicodin</title>

<style>

body {
    width: 1080px;
    background-color: black;
    margin: 0;
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}

#counter {
    position: absolute;
    bottom: 0;
    max-width: 100%;
}

.ssz1 {
    margin-top: 3.13rem;
    text-align: center;
    font-family: 'crete round';
    font-size: 2rem;
    line-height: 2.25rem;
    font-weight: bold;
    color: #ebf6ff;   /* PALE BLUE */
}
.ssz2 {
    text-align: center;
    margin-bottom: 1.75rem;
    font-family: 'crete round';
    font-size: 1.75rem;
    line-height: 2rem;
    font-weight: bold;
    color: #ebf6ff;   /* PALE BLUE */
}

.henpen {
    text-align: center;
    color: #ffffee;   /* ivory */
    margin: 2.5rem 16% 0rem 16%;
    font-size: 3.75rem;
    line-height: 3.88;
    font-weight: 700;
    font-family: 'Henny Penny', cursive;
}

.thanks {
    margin: 2.5rem 15% 6.25rem 15%;
    color: #ffffee;   /* ivory */
    text-align: center;
    font-style: italic;
    font-family: 'crete round', serif;
    font-size: 2.25rem;
    line-height: 2.38rem;
    font-weight: bold;
}
.hilite {
    margin: 2rem 2.94rem 1rem 2.94rem;
    text-align: center;
    font-style: italic;
    color: black;
    background-color: white;
    font-family: 'crete round', serif;
    font-size: 2.25rem;
    line-height: 2.38rem;
    font-weight: bold;
}

td {
    padding-top: .4rem;
    padding-right: .4rem;
    padding-bottom: .4rem;
    padding-left: .7rem;
}
.design1 {
    width: 88%;          /*    DESCRIPTION    */
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.here {
    color: #888888;
    font-family: 'roboto slab', serif;
    font-weight: 400;
	font-size: 2.5rem;
    line-height: 2.63rem;
}

/* ━━━━━━━━ TABLE 2 ━━━━━━━━ */
.table2 th {
    border-bottom: 1.75rem groove #bbac86;    /* mushrooms */
    width: auto;
    color: #ffffee;        /* ivory */
    text-align: center;
    font-style: italic;
    background-color: black;
    font-family: 'crete round', serif;
    font-size: 4rem;
    line-height: 4.25rem;
    font-weight: bold;
}
.group2 {          /*   CLASS LETTER (A-E)    */
    width: 8%;
    font-family: 'calistoga', serif;
    font-weight: 400;
	font-size: 2.75rem;
    line-height: 2.88rem;
    color: blue;
}
.design2 {
    width: 88%;          /*    DESCRIPTION    */
    color: blue;
    font-family: 'calistoga', serif;
    font-weight: 400;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.table2 {
    width: auto;
    margin: 2.25rem 9% 0rem 9%;
    border-top: 1.75rem groove #bbac86;    /* mushrooms */
    border-left: 1.75rem groove #bbac86;    /* mushrooms */
    border-right: 1.75rem groove #bbac86;    /* mushrooms */
    border-collapse: collapse;
    font-family: 'roboto slab', serif;
    font-size: 2.25rem;
    line-height: 2.31rem;
    font-weight: bold;
    color: black;
}
.table2 tbody tr:nth-child( odd ) {
    background-color:  white;
}
.table2 tbody tr:nth-child( even ) {
    background-color: #ebf6ff;   /* PALE BLUE */
}
.table2 tbody tr td:nth-of-type(1) {
    border-right: .19rem solid black;
    text-align: center;
}
.table2 tbody tr td:nth-of-type(2) {
    border-right: .19rem solid black;
    text-align: left;
}
/* ━━━━━━━━ TABLE 3 ━━━━━━━━ */
.group3 {  /* CLASS LETTER (A-E) */
    width: 8%;
    font-family: 'calistoga', serif;
    font-weight: 400;
	font-size: 2.75rem;
    line-height: 2.88rem;
    color: green;
}
.design3 {
    width: 88%;  /* DESCRIPTION */
    color: green;
    font-family: 'calistoga', serif;
    font-weight: 400;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.table3 {
    width: auto;
    margin: 0rem 9% 1.25rem 9%;
    border-bottom: 1.75rem groove #bbac86;    /* mushrooms */
    border-right: 1.75rem groove #bbac86;    /* mushrooms */
    border-left: 1.75rem groove #bbac86;    /* mushrooms */
    border-collapse: collapse;
    font-family: 'roboto slab', serif;
    font-size: 2.25rem;
    line-height: 2.31rem;
    font-weight: bold;
    color: black;
}
.table3 tbody tr:nth-child( odd ) {
    background-color:  white;
}
.table3 tbody tr:nth-child( even ) {
    background-color: #f3ffeb;  /* PALE GREEN */
}
.table3 tbody tr td:nth-of-type(1) {
    border-right: .19rem solid black;
    text-align: center;
}
.table3 tbody tr td:nth-of-type(2) {
    border-right: .19rem solid black;
    text-align: left;
}
/* ━━━━━━━━━━ COLORS ━━━━━━━━━━━ */

.ivory {
    color: #ffffee;
    text-align: center;
    margin: 2.25rem 0rem 2.25rem 0rem;
}
.blu {color: blue}
.blub {color: blue; font-weight: bold;}
.fusch {color: #ca009b}
.fuschb {color: #ca009b; font-weight: bold}
.fuschi {color: #ca009b; font-style: italic}
.crim {color: crimson}
.crimb {color: crimson; font-weight: bold}
.crimi {color: crimson; font-style: italic}
.grey {color: grey}
.green {color: #248900}  /* green */
.greenb {color: #248900; font-weight: bold}

/* ━━━━━━━━━ LINKS ━━━━━━━━━━━ */

a:active {color: crimson}
a:hover {color: crimson}
a:link {color: blue}
a:visited {color: blue}

.redlink a:link {color: crimson}
.redlink a:visited {color: crimson}

.whlink a:link {color: #ffffee}  /* ivory */
.whlink a:visited {color: #ffffee}  /* ivory */

.bk1link a:link {
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.bk1link a:visited {
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.bk2link a:link {
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.bk2link a:visited {
    color: black;
    font-family: 'roboto slab', serif;
    font-weight: 700;
	font-size: 2.5rem;
    line-height: 2.63rem;
}
.bnlink a:link {
      padding-bottom: 10px;
      color: #bbac86;    /*  BROWN  */
      background: black;
      text-align: center;
      font-style: italic;
      font-family: 'roboto condensed', sans-serif;
      font-size: 1.88rem;
      line-height: 2rem;
      font-weight: 700;
}
.bnlink a:visited {
      padding-bottom: 10px;
      color: #bbac86;    /*  BROWN  */
      background: black;
      text-align: center;
      font-style: italic;
      font-family: 'roboto condensed', sans-serif;
      font-size: 1.88rem;
      line-height: 2rem;
      font-weight: 700;
}

/* ━━━━━━ MISCELLANEOUS ━━━━━━━ */

.ctr {text-align: center}
.undr {text-decoration: underline}

.clamwh {
	color: #ffffee;   /* IVORY */
	font-style: italic;
	font-family: roboto, sans-serif;
    font-size: 2.69rem;
    font-weight: 900;
}
.clambu {
	color: #ebf6ff;   /* PALE BLUE */
	font-style: italic;
	font-family: roboto, sans-serif;
    font-size: 2.69rem;
    font-weight: 900;
}
.clambk {
	color: black;
	font-style: italic;
	font-family: roboto, sans-serif;
    font-size: 2.69rem;
    font-weight: 900;
}
.clamcr {
	color: crimson;
	font-style: italic;
	font-family: roboto, sans-serif;
    font-size: 2.69rem;
    font-weight: 900;
}
.clambu {
	color: blue;
	font-style: italic;
	font-family: roboto, sans-serif;
    font-size: 2.69rem;
    font-weight: 900;
}
/* ━━━━━━━━━ END CSS ━━━━━━━━━━ */

</style>
</head>

<body>

<div class="ssz1">
This Is A Small Screen Zone*</div>
<div class="ssz2">
*Designed and built for SmartPhones<span class="clamlbu">!</span></div>

<table class="table2">
        <thead>
<tr>
<th colspan="2">Table of Contents</th>
                </tr>
        </thead>
<tbody>

<tr>
        <td class="group2"></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/index.html" target="_blank">Home</a></span>
        </td>
        </tr>
<tr>
        <td class="group2"></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/about.html" target="_blank">About</a></span></td>
        </tr>
<tr>
        <td class="group2"></td>
        <td class="design1">
Table of Contents <span class="here">(You Are Here)</span></td>
        </tr>
<tr>
        <td class="group2"></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/#_THRU_J/shout_ellipse_01.html" target="_blank">&lt;shape-outside: ellipse&gt;</a></span></td>
        </tr>
<tr>
        <td class="group2"></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/#_THRU_J/shout_polygon_01.html" target="_blank">&lt;shape-outside: polygon&gt;</a></span></td>
        </tr>
<tr>
        <td></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/K_THRU_Z/uspspod01.html" target="_blank">Complex Business Letter</a></span> Form for 2 Addressees w&#47;USPS P.O.D. Counter Roll Sticker Positions
</td>
        </tr>

<tr>
        <td></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/K_THRU_Z/rem_conversion_chart.html" target="_blank">REM Conversion Chart</a></span> Flex w&#47;nth Child</td>
        </tr>

<tr>
        <td class="group2"></td>
        <td class="design1">
            <span class="bk1link">
<a href="https://semicodin.nekoweb.org/K_THRU_Z/vert_center_image_w_text.html" target="_blank">Vertically Center an Image</a></span> &amp; Horizntly Including Text w&#47;Page Counter Footer</td>
        </tr>
<tr>
        <td class="group2">A.</td>
        <td class="design2">CSS &mdash; PARCHMENT w&#47;BORDER</td>
        </tr>
<tr>
        <td></td>
        <td>1 TAB CSSPAR1 &mdash; Coming Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>1 TAB CSSPAR1_ANI &#47; ANIMATED &mdash; Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>2 TABS CSSPAR2 &mdash; Coming Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>2 TABS CSSPAR_ANI &#47; ANIMATED &mdash; Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>3 TABS CSSPAR3 &mdash; Coming Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>3 TABS CSSPAR3_ANI &#47; ANIMATED &mdash; Soon!</td>
        </tr>
<tr>
        <td></td>
        <td>7 TABS CSSPAR7 &mdash; Coming Soon!</td>
        </tr>
</tbody>
</table>

<div class="ivory">
Got Questions? You can PM me at<br>
<span class="whlink">
<a href="https://sitepoint.com/community/u/semicodin/activity">the Sitepoint Forums</a></span><span class="clamwh">!</span>
<br>
<br>
</div>
<div class="thanks">
The author would also like to thank the fine artists at Inkscape Forum for their valuable contribution in rendering
<br>
<span class="hilite">&nbsp;3 very clean&nbsp;</span>
<br>
masters of the tabs in SVG, most especially &ldquo;polygon&rdquo; and &ldquo;tyler&rdquo;. You guys are the best! Until we meet again&nbsp;.&nbsp;.&nbsp;.
</div>


<div id="counter">
<!-- Histats.com  START (html only)-->
<a href="/" alt="page hit counter" target="_blank" >
<embed src="//s10.histats.com/430.swf"  flashvars="jver=1&acsid=4873214&domi=4"  quality="high"  width="112" height="75" name="430.swf"  align="middle" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" wmode="transparent"></a>
<img  src="//sstatic1.histats.com/0.gif?4873214&101" alt="html hit counter" border="0">
<!-- Histats.com  END  -->
</div>

</body>
</html>

I assume you mean the bottom of the document and not the viewport?

If so remove all the styles from #counter and just use text-align: center on #counter.

1 Like

Yes that’s correct. So just plain old text-align it is. Thank you Paul!

Erm . . . the whole counter is a style isn’t it?

Removing position: absolute; worked. I’m not sure what I was thinking regarding this particular page Paul. I mean — I transferred his counter from my vert-center graphic which is a completely different kind of page lol. I’ve been working too hard! :tongue:

Not sure what you mean but you had this:

#counter {
    position: absolute;
    bottom: 0;
    max-width: 100%;
}

It just needs to be this:

#counter {
   text-align:center;
}
1 Like

Yes indeed. :tongue:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.