Creating an Article Page.
Tags: articlepage, responsivedesign, interactivepage, semantichtml
Published: 2017-08-20 16:17:07

---
title: Creating an Article Page.
published: true
description: Designing a semantically correct responsive and interactive article page.
tags: Article page, Responsive design, Interactive page, Semantic HTML
---
<p data-height="265" data-theme-id="light" data-slug-hash="OjQzZw" data-default-tab="html,result" data-user="cfjr" data-embed-version="2" data-pen-title="Semantically correct Responsive Design of Interactive Article Page" class="codepen">See the Pen <a href="https://codepen.io/cfjr/pen/OjQzZw/">Semantically correct Responsive Design of an Interactive Article Page</a> by Rounak Polley (<a href="https://codepen.io/cfjr">@cfjr</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
![Preview of the design](https://thepracticaldev.s3.amazonaws.com/i/oiceybajo3jv8zns14ao.PNG)

*Sometimes we forget the importance of writing correct html*
Though almost every thing can be achieved by using `<div>` and `<span>` tags but it doesn't tell us what the content is actually on the page and where it is.
Semantic html is using html to reinforce structural meaning. It’s about using tags, class names, and ids that reinforce the meaning of the content within the tags. By adding semantic tags to our document, we provide additional information about that document, which aids in communication. Specifically, semantic tags make it clear to the browser what the meaning of a page and its content is. This clarity is also communicated to the search  engines, ensuring that the right pages are delivered for the right queries.
(Now, that's really important everybody wants their website to rank higher in search engine results.)

Read more at <a href="https://www.w3schools.com/html/html5_semantic_elements.asp">HTML5 Semantic Elements</a> .
![A pictorial representation of html5 semantics](https://www.w3schools.com/html/img_sem_elements.gif)
(Here, in this example I haven't added the `<nav>`, `<header>` or `<footer>` as they can be separately designed).

Now, actually getting in the making of the article page. Article pages have been extremely common on the internet since the beginning and continue to do so weather in form of blogs, news etc. 
When the article in itself is big it must be broken down into sections using `<section>` tags with individual `<headers>` and the `<article>` itself needs an `<header>`. Placing the images in `<figure>` with optional `<figcaption>` is a good practice and of course, `<img>` must have an `alt` attribute.

But, we can do much more, because for web design **magic is in the details**.
We can facilitate the user in finding the right content within our article it can be done by adding an in-page navigation a way to do that is using `<aside>` with `role="navigation"` (simplifies things for assistive technologies). Again instead of using simple anchors with links we can use **jQuery** to indicate the part of article the user is currently on and scroll smoothly through individual parts.

Next, a responsive design (using **Bootstrap**) is always great !

If you are still using table layout it's time you learn Bootstrap because using table to layout pages is an extremely bad practice.
*(Why the web-developer walked out of the café ? Because he didn't like the table-layout !)*

When using Bootstrap instead explicitly specifying the width and/or height of images we can just add another 'row' in the present column (or group of columns) and specify how much width we want the image to take within that (adding appropriate Bootstrap call to the `<img>` tag) and by default aspect ratio is maintained.
*It's like nesting Bootstrap rows (rows within rows).*

We should always check our design in the developer tools emulator and by resizing the browser in every way possible. Also, among Chrome, Mozila, Edge and IE I have found that IE gives more troubles (no doubt folks hate it creating all the memes & posts on IE). So, check on IE as well (because people out there still use it and it's not that bad actually).
So, I found that the fixed positioned `<aside>` was actually getting partially hidden so I had to add an `overflow-y : auto`.

Simple design is sometimes more elegant and appropriate. Instead of using lot of colours and fancy fonts simple and clear fonts and various shades of well matched grey usually does the trick.

Last, but not the least we can add `<summary>` here, I have put some quotes (using `<q>` instead of regular `" "`).

For more details ...
<p data-height="265" data-theme-id="light" data-slug-hash="OjQzZw" data-default-tab="html,result" data-user="cfjr" data-embed-version="2" data-pen-title="Semantically correct Responsive Design of Interactive Article Page" class="codepen">See the Pen <a href="https://codepen.io/cfjr/pen/OjQzZw/">Semantically correct Responsive Design of an Interactive Article Page</a> by Rounak Polley (<a href="https://codepen.io/cfjr">@cfjr</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script>