Kompx.com or Compmiscellanea.com

Pure CSS responsive square

Windows : Internet Explorer 8.0+, Firefox 1.0+, Google Chrome, Opera 4.0+, Safari 3.1+, SeaMonkey 1.0+ [ 1 ].

Linux : Firefox 1.0+, Google Chrome / Chromium, Opera 5.0+, SeaMonkey 1.0+ [ 2 ], NetSurf 3.0+, Hv3.

Responsive CSS square. No JavaScript / jQuery. Example:

 

HTML / XHTML. Code:

<div class="square">&nbsp;</div>

CSS. Code:

.square {width: 10%; height: 0; padding-bottom: 10%;}

/* Extra CSS, just styling the look: */

.square {background: #fd0;}

Width: 10% makes the .square div to be 10% of the parent element's width. Height: 0 eliminates any height the element may have, letting padding-bottom: 10% to make it exactly equal to the width. So each time the width of the parent container is changed, the element's size gets recalculated.

Based on the concept - CSS grid with responsive square cells:

Square cell 1
Square cell 2
Square cell 3
Square cell 4
Square cell 5
Square cell 6
Square cell 7
Square cell 8

[ 1 ]

As well as Netscape 6.01+, Mozilla 0.6+.

[ 2 ]

As well as Netscape 6.01+, Mozilla 0.6+.


Aliosque subditos et thema

 

HTTP to HTTPS redirect in .htaccess

 

Redirecting from all domain names of a web site to its web address with HTTPS and the domain with www. The names to be redirected from are: Both with and without www - URL with HTTP Without www - URL with HTTPS Server configuration: Apache + nginx. SSL is enabled. SSL-certificate is purchased, approved and installed. That is, everything is up and running. So it is just the HTTP to HTTPS redirection that is left to get ready and start up. Directives for .htaccess file: RewriteEngine On RewriteCond %{HTTP:HTTPS} !on [NV] RewriteRule ^(.*)$ https://www.domain.tld/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ https://www.domain.tld/$1 [R=301,L] HTTP to HTTPS redirect in detail -- Enable runtime rewriting engine: RewriteEngine On -- If HTTPS is not present: RewriteCond %{HTTP:HTTPS} !on [NV] -- Then replace HTTP + domain (with or without www) with HTTPS + domain with www: RewriteRule ^(.*)$ https://www.domain.tld/$1 [R=301,L] -- If HTTPS is present, but domain name has no www (the case when https://domain.tld is entered in address bar): RewriteCond %{HTTP_HOST} !^www\. -- Then replace it with HTTPS + domain with www: RewriteRule ^(.*)$ https://www.domain.tld/$1 [R=301,L] Notes RewriteCond %{HTTP:HTTPS} !on [NV] is not the only way to detect if HTTPS is not present. Moreover, for some server configurations other directives may be more suitable, like RewriteCond %{SERVER_PORT} !443 for example. The point is to find out somehow if HTTPS is not on. So it should probably be checked by practice what is going to work in a particular case. Apache Module mod_rewrite docs: http://httpd.apache.org/docs/current/mod/mod_rewrite.html

HTML table borders without CSS

 

Example n.1:   HTML table borders without CSS   cellspacing="2"   bgcolor="#ff6600" HTML / XHTML. Code: <table width="100%" cellspacing="2" cellpadding="0" border="0" align="center" bgcolor="#ff6600"> <tr bgcolor="#ffffff"> <td width="33%" height="67">&nbsp;</td> <td width="34%">HTML table borders without CSS</td> <td width="33%">&nbsp;</td> </tr> <tr bgcolor="#ffffff"> <td height="67">cellspacing="2"</td> <td>&nbsp;</td> <td>bgcolor="#ff6600"</td> </tr> </table> Example n.2:   HTML table borders without CSS   cellspacing="8"   bgcolor="#999999" HTML / XHTML. Code: <table width="100%" cellspacing="8" cellpadding="0" border="0" align="center" bgcolor="#999999"> <tr bgcolor="#ffffff"> <td width="33%" height="67">&nbsp;</td> <td width="34%">HTML table borders without CSS</td> <td width="33%">&nbsp;</td> </tr> <tr bgcolor="#ffffff"> <td height="67">cellspacing="8"</td> <td>&nbsp;</td> <td>bgcolor="#999999"</td> </tr> </table> Example n.3 - for Netscape 3.04-6.0, Mozilla 0.6-0.92 and Arachne.