Continued from above ....
Eric Watson: Firefox only
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Eric Watson - Erik's Test</title>
<style type="text/css">
* {
margin:0;
padding:0;
}
html, body {
height:100%;
color:red;
font-size:2.5em;
line-height:0;
font-family:Arial;
}
div {
height:50%;
width:50%;
position:relative;
top:25%;
margin:0 auto;
border:10px solid #000;
}
p {
height:50%;
width:50%;
margin:-10px auto 0;
border:10px solid #000;
position:relative;
top:25%;
}
span {
display:block;
position:relative;
top:50%;
margin:-5px -145% 0;
border-top:10px solid #000;
text-align:center;
}
</style>
</head>
<body>
<div>
<p><span>X</span></p>
</div>
</body>
</html>
Roobear - Firefox and OPera
(Used the outline property to circumvent the opera bug mentioned above)
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ro0bear - firefox and opera</title>
<style type="text/css">
* {
font-size: 1.5em;
line-height: 0;
margin: 0;
padding: 0;
font-family: sans-serif;
}
html {
background-color: white;
height: 100%;
}
body {
background-color: black;
position: relative;
top: 49%;
height: 2%;
}
div {
width: 80%;
height: 4000%;
position: relative;
top: -1950%;
left: 10%;
outline: black 10px solid;
}
p {
width: 60%;
height: 60%;
position: relative;
top: 20%;
left: 20%;
text-align: center;
outline: black 10px solid;
}
span {
color: red;
height: 0;
position: relative;
top: 52%;
}
</style>
</head>
<body>
<div>
<p> <span>X</span> </p>
</div>
</body>
</html>
Centauri - Firefox and IE
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
overflow: hidden;
}
body {
border-top: 10px solid black;
position: relative;
top: 50%;
height: 80%;
margin-top: -5px;
font-size: 3.76em;
line-height: 1;
}
div {
width: 70%;
margin: -15px auto 0;
border: 10px solid black;
height: 100%;
position: relative;
top: -50%;
}
p {
border: 10px solid black;
width: 50%;
height: 50%;
position: relative;
top: 25%;
margin: -10px auto 0;
}
span {
color: #FF0000;
position: relative;
top: 50%;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
margin-top: -0.535em;
display: block;
text-align: center;
line-height: 1em;
}
</style>
</head>
<body>
<div>
<p> <span>X</span> </p>
</div>
</body>
</html>
Raffles- opera
(Also used outline but also used display:table to center)
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Raffles - opera Untitled Document</title>
<style>
* {margin:0; padding:0}
html {height:100%}
body {
height:50%;
border-bottom:10px solid black;
top:-10px;
padding-top:5px;
position:relative;
}
body * {
outline:10px solid black;
position:relative;
margin:0 auto
}
div {
height:160%;
width:60%;
top:20%;
margin-top:3px;
display:table;
padding:10%
}
p {
height:40%;
width:60%;
display:table-cell;
vertical-align:middle
}
span {
display:block;
color:red;
font:bold 500% sans-serif;
outline:0;
text-align:center;
}
</style>
</head>
<body>
<div>
<p> <span>X</span> </p>
</div>
</body>
</html>
MarkBrown4 - Firefox OPera and Safari but uses a loophole
(This uses absolute positioning which was ruled out in the instructions as fixed positioning is basically absolutely positionng but with the viewport as the containing block)
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Mark Brown - Firefox, Opera and Safari</title>
<style type="text/css">
* { margin: 0; padding: 0 }
html, body {
height: 100%;
font-size: 200%;
color: red;
text-align: center;
}
div {
height: 50%;
border-bottom: 5px solid #000;
margin-top: -2px;
}
p {
border: 5px solid #000;
position: fixed;
top: 20%;
bottom: 20%;
left: 20%;
right: 20%;
}
span {
border: 5px solid #000;
text-indent: -9999px;
position: fixed;
top: 40%;
bottom: 40%;
left: 40%;
right: 40%;
}
body:after {
content: 'X';
text-indent: 0;
display: block;
vertical-align: middle;
margin-top: -.62em;
}
</style>
</head>
<body>
<div>
<p> <span>X</span> </p>
</div>
</body>
</html>
Force Flow - Firefox and OPera
(Simple version without dividing line - uses display:table to nice effect)
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Force Flow - FF/opera - no middle line</title>
<style type="text/css">
html, body, p {
padding: 0px;
margin: 0px;
}
html, body, div, p { height: 100%; }
body, p {
width: 50%;
height: 50%;
display: table;
margin: 0 auto;
}
body {
position: relative;
top: 25%;
}
div, span {
display: table-cell;
vertical-align: middle;
}
p {
overflow: hidden;
text-align:center;
}
div, p {
border: 10px solid black;
}
span {
font-family: Verdana, Geneva, sans-serif;
color: red;
font-size: 3em;
font-weight: bold;
}
</style>
</head>
<body>
<div>
<p><span>X</span></p>
</div>
</body>
</html>
I had many other entries which I haven't shown as they used similar methods to above so thanks to all. If I haven't posted your favourite submission then feel free to post it yourself.
Thanks to all for taking part and keep a look out for the next quiz which will follow in a couple of days
Bookmarks