From 2ba10858ea8a8979161f2bee77caf82cf17c1f21 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 23 Aug 2024 10:22:49 +0200 Subject: [PATCH 1/3] 0823 my first html page --- myhtml.html | 12 ++++++++++++ test.txt | 1 - test2.txt | 1 - untracked.txt | 2 -- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 myhtml.html delete mode 100644 test.txt delete mode 100644 test2.txt delete mode 100644 untracked.txt diff --git a/myhtml.html b/myhtml.html new file mode 100644 index 0000000..284b1e4 --- /dev/null +++ b/myhtml.html @@ -0,0 +1,12 @@ + + + + + Dan's Homepage >3< + + + + My test image + Hi, my name is Dan. + + diff --git a/test.txt b/test.txt deleted file mode 100644 index 5f97c87..0000000 --- a/test.txt +++ /dev/null @@ -1 +0,0 @@ -today diff --git a/test2.txt b/test2.txt deleted file mode 100644 index 5f97c87..0000000 --- a/test2.txt +++ /dev/null @@ -1 +0,0 @@ -today diff --git a/untracked.txt b/untracked.txt deleted file mode 100644 index 2e05357..0000000 --- a/untracked.txt +++ /dev/null @@ -1,2 +0,0 @@ -untracked file -untracked file From 36cde5283f19947b77c7dd320b0c8f7c8a085d89 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 23 Aug 2024 13:23:25 +0200 Subject: [PATCH 2/3] 0823 add initial js and css --- mycss.css | 14 ++++++++++++++ myhtml.html | 2 ++ myjs.js | 21 +++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 mycss.css create mode 100644 myjs.js diff --git a/mycss.css b/mycss.css new file mode 100644 index 0000000..e1ded88 --- /dev/null +++ b/mycss.css @@ -0,0 +1,14 @@ +html { + background-color: green; + font-size: 20px; +} + +ul { + background: red; + padding: 10px; + border: 1px solid black; +} + +li { + margin-left: 20px; +} diff --git a/myhtml.html b/myhtml.html index 284b1e4..f740afa 100644 --- a/myhtml.html +++ b/myhtml.html @@ -1,6 +1,8 @@ + + Dan's Homepage >3< diff --git a/myjs.js b/myjs.js new file mode 100644 index 0000000..767d384 --- /dev/null +++ b/myjs.js @@ -0,0 +1,21 @@ +const list = document.createElement('ul'); +const info = document.createElement('p'); +const html = document.querySelector('html'); + +info.textContent = 'Below is a dynamic list. Click anywhere on the page to add a new list item. Click an existing list item to change its text to something else.'; + +document.body.appendChild(info); +document.body.appendChild(list); + +html.onclick = function() { + const listItem = document.createElement('li'); + const listContent = prompt('What content do you want the list item to have?'); + listItem.textContent = listContent; + list.appendChild(listItem); + + listItem.onclick = function(e) { + e.stopPropagation(); + const listContent = prompt('Enter new content for your list item'); + this.textContent = listContent; + } +} From f8deca4cbfcb934ec5afa52f4109db1f003860da Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 23 Aug 2024 13:41:29 +0200 Subject: [PATCH 3/3] 0823 use ul list --- myhtml.html | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/myhtml.html b/myhtml.html index f740afa..e332085 100644 --- a/myhtml.html +++ b/myhtml.html @@ -1,14 +1,20 @@ - - - + + + Dan's Homepage >3< - + My test image - Hi, my name is Dan. +

Hi, my name is Dan.

+
    +
  • Education
  • +
  • Work Experience
  • +
  • Languages
  • +
  • Hobbies
  • +