-
Notifications
You must be signed in to change notification settings - Fork 0
/
social2.html
89 lines (67 loc) · 3.32 KB
/
social2.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<html>
<head>
<title>Social Links Profile</title>
<link rel="stylesheet" href="socialstyle2.css">
</head>
<body>
<br>
<br>
<div class="wrapper">
<br>
<p class="circular-image"><img src="C:\Users\hp\Desktop\avatar-jessica.jpeg"="my profile pic" ></p>
<P id="paragraph" class="align" >Jessica Randall</p>
<p id="style" class="align" >London, United Kingdom</p>
<p class="style2">"Front end developer and avid reader"</p>
<br>
<P id="boxmodels" class="align"><a href="https://github.com/snehasaha1101">GitHub</a></P>
<p id="boxmodels" class="align"><a href="https://www.linkedin.com/in/sneha-saha-46298b286">Linkedin </a></p>
<p id="boxmodels" class="align"><a href="https://www.hackerrank.com/profile/sahasneha1198">HackerRank</a></p>
<p id="boxmodels" class="align"><a href="https://leetcode.com/code_sneha/">Leetcode</a></p>
<style>
.box {
background-color:rgb(183, 176, 176);
border: 1px solid aliceblue;
width:70%;
padding:10;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.link {
color: #007bff;
text-decoration: none;
}
.link:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<button id="addButton">Add a new social media link</button>
<div id="contentContainer"></div>
<script>
document.addEventListener("DOMContentLoaded", function() {
var addButton = document.getElementById("addButton");
var contentContainer = document.getElementById("contentContainer");
addButton.addEventListener("click", function() {
var name = prompt("Enter a name:");
var link = prompt("Enter a link:");
if (name && link) {
var box = document.createElement("div");
box.classList.add("box");
var anchor = document.createElement("a");
anchor.textContent = name;
anchor.href = link;
anchor.classList.add("link");
box.appendChild(anchor);
contentContainer.appendChild(box);
} else {
alert("Both name and link are required.");
}
});
});
</script>
</div>
<br>
</body>
</html>