Dev.to WebDev 🛠 Dev 👁 0 📖 6 min read

My first website was ugly, and it worked

My uncle gave our family a monitor when I was a kid, a huge beige box that sat next to our dial-up modem. Every night I sat through the screech and waited while pages loaded one strip at a time, and somewhere in those sl

My uncle gave our family a monitor when I was a kid, a huge beige box that sat next to our dial-up modem. Every night I sat through the screech and waited while pages loaded one strip at a time, and somewhere in those slow evenings I decided I wanted to know how the pages got made. I am a software engineer today because of that hand-me-down, and the first thing it taught me to build was a website so ugly I am almost proud of it.

The site was a personal page, the kind every kid made back then. A big heading with my name, a paragraph about me, a list of my favorite things, and a photo that did not load. I wrote it in Notepad, one file called index.html, and I opened it in the browser by double-clicking it. No server, no build step, no framework. Just a file on the desktop and a browser that knew what to do with it.

Here is the page, more or less the way I wrote it. Every mistake is still in there, because the mistakes are the interesting part.

index.html

<html>
<head>
  <title>Nayem's Page</title>
</head>
<body bgcolor="#FFFFCC">
  <center>
    <font face="Comic Sans MS" size="6" color="#0000FF">
      Welcome to Nayem's Page!!!
    </font>
  </center>
  <br><br>
  <table border="1" width="100%">
    <tr>
      <td>
        <font face="Arial" size="3">
          Hi, my name is Nayem. I like computers,
          cricket, and drawing. This is my website.
        </font>
      </td>
    </tr>
  </table>
  <br><br>
  <img src="me.jpg" width="200">
  <br><br>
  <center>
    <a href="https://www.google.com">My favorite website</a>
  </center>
  <br><br>
  <marquee>Thanks for visiting my page!</marquee>
</body>
</html>

what broke first

The photo was the first thing that broke, and it stayed broken for weeks. The picture was saved as me.jpg on the desktop, and the HTML file sat in a folder, so the browser looked for the picture next to the file and found nothing. The page showed a broken-image icon instead. The bug was a relative path: the browser resolves src against the page's location, not the desktop. The fix was moving the file, not rewriting the page. The rule that came out of it: an asset lives next to the page that references it, or the path says where it lives.

The layout was a table, because that was how everyone laid out a page back then. CSS existed, but I had not met it yet, and a table with a border was the only way I knew to put a box around text. The spacing was br tags, two at a time, stacked until the gap looked right. The page had no structure. It was a pile of tags that happened to look like a page, and every change meant counting line breaks.

The center and font tags did the styling, one tag at a time, and the marquee at the bottom scrolled a message across the screen, because every page back then had to scroll something. Both of those tags are retired from the spec now, which tells you how long ago this was, and the browser still renders them, because the web is kind to old pages.

then I met CSS

The change came from View Source. I right-clicked a page I liked and read its code, which is still the best way I know to learn how a page works. That page had a style block at the top, and inside it were rules that said what things should look like, separate from the things themselves. I copied the idea, and my page went from inline attributes on every tag to a handful of rules in one place.

The first rule I wrote was probably font-family. The second was color. The third was margin, and that one felt like a superpower, because the br tags I had been stacking to make space could finally go away. A margin of 40px did what eight line breaks used to do, and it did it on purpose. Here is the same page rebuilt the way I would write it now, same words, same photo, same link, with the styling moved into its own file.

index.html

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Nayem's Page</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main>
    <h1>Welcome to Nayem's Page</h1>
    <p>
      Hi, my name is Nayem. I like computers,
      cricket, and drawing. This is my website.
    </p>
    <img src="me.jpg" alt="A photo of Nayem" width="200">
    <p>
      <a href="https://www.google.com">My favorite website</a>
    </p>
  </main>
</body>
</html>

style.css

body {
  font-family: Georgia, serif;
  background: #fffdf5;
  color: #1c1c1e;
  line-height: 1.6;
  margin: 0;
}

main {
  max-width: 640px;
  margin: 40px auto;
  padding: 0 20px;
}

h1 {
  font-size: 32px;
  margin-bottom: 16px;
}

img {
  display: block;
  border-radius: 8px;
  margin: 24px 0;
}

a {
  color: #0d9488;
}

Two files instead of one, and the HTML got shorter, not longer. Every font tag is gone, the center tags are gone, the table is gone, and the page looks better. The link tag in the head is the whole trick: one line that says the styles live over there, in style.css, and the browser goes and gets them.

Try it: the same page, then and now
Try it live on nayemalam.com.

The demo above is the same page, twice. Flip between the two versions and watch what changes. The words, the list, and the link stay the same. Only the styling moves, out of the markup and into rules of its own, and that move is the entire difference between the two.

what the first site taught me

The first lesson is that HTML is forgiving, which is the kindest thing about it. The doctype was missing, tags went unclosed, nesting was wrong, and the browser showed a page anyway. A stricter language would have handed me an error and nothing else. HTML handed me a page with a broken photo and a crooked table, and I could see what to fix. That forgiveness is why a kid with Notepad can build a website on the first try.

The second is that content and presentation are two different jobs, and they belong in two different places. The moment the styling left the markup, the page got easier to change. A new color meant one line in the stylesheet, not a search through every tag. That is separation of concerns, learned by feel before it had a name.

The third is that shipping something ugly beats planning something perfect. I did not read a book on HTML first. I opened Notepad, typed tags I had seen in View Source, and double-clicked the file. The page was ugly and it worked, and working was enough to keep me going. Every site since has been the same move with better tools.

The web rewards starting small. One file, opened straight from the desktop, carries the craft in miniature: tags, paths, and the line between content and presentation. Every site since is that same page with better tools. The ugly version was not a mistake to skip past. It was the lesson, and it worked, broken photo and all.

Originally posted on nayemalam.com/blog.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.