html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1 align=center> Page title</h1>
<img src= "http://www.sololearn.com/uploads/slider/3.jpg"
alt="" id=photo width=99%>
<h2>Subtitle</h2>
<p>This is some random text I wrote just to make the code look better , and you are not supposed to read it. The main attraction is the Photo.<br />If you are still reading this , please stop because this text is made just to make the code look beautiful. It has no useful informations. Why are you still reading? If you still read this , I am gonna tell you something you may not know... The "id" of any html tag can be used as an object , so you can use something.innerText="Abracadabra" , the "something" being the id of an paragraph ,for example.However , it is safer to use "document.getElementById("something")"
<br />I used it on this code too. Check the line 27 if you want.</p>
<hr>
<footer>Page footer <br />informations about Contact and stuffs.</footer>
<script>
//the list of images we want to use in our Page.
var images = [
"http://www.sololearn.com/uploads/slider/1.jpg",
"http://www.sololearn.com/uploads/slider/2.jpg",
"http://www.sololearn.com/uploads/slider/3.jpg"
];
var a=0
var rand = images[Math.floor(Math.random() * images.length)];
function om(){
if (a<=2){
photo.src=images[a]
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
img{
border:3px solid black;
}
p{
font-weight:bolder;
font-size:110%;
word-spacing:3px;
}
footer{
font-weight:bold;
font-size:70%;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run