Code Monkey home page Code Monkey logo

code-refactor's Introduction

Code-Refactor

This is an on-the-job ticket assignment to clean up the given code

User Story

AS A marketing agency
I WANT a codebase that follows accessibility standards
SO THAT our own site is optimized for search engines

Acceptance Criteria

GIVEN a webpage meets accessibility standards
WHEN I view the source code
THEN I find semantic HTML elements
WHEN I view the structure of the HTML elements
THEN I find that the elements follow a logical structure independent of styling and positioning
WHEN I view the icon and image elements
THEN I find accessible alt attributes
WHEN I view the heading attributes
THEN they fall in sequential order
WHEN I view the title element
THEN I find a concise, descriptive title

My Implementation

I began by looking through the index.html and noticed that the elements were not cascaded in a way that was easily read. For example

From this...

<nav>
<ul>
<li>
<a href="#search-engine-optimization">Search Engine Optimization</a>
</li>
</ul>
</nav>

To this...

<nav>
    <ul>
        <li>
            <a href="#search-engine-optimization">Search Engine Optimization</a>
        </li>
    </ul>
</nav>

While doing this I also noticed that there were no semantic html elements defining parts on the page, so I removed and added them where necessary. For example

From this...

<div class="content">        
    <div id="search-engine-optimization" class="search-engine-optimization">
</div>

To this...

<section class="content">
    <div id="search-engine-optimization" class="search-engine-optimization">
</section>

I then added the alt attribute to all the <img> tags so that I can name them based on what is being displayed. For example

<img src="./assets/images/search-engine-optimization.jpg" class="float-left" alt="Desk with booklet that says SEO" />

This allows the image to be better accesible because it has a description.

I then began looking at the style.css file and noticed that a lot of the css rule sets were redundant. Some of them were created sperate however contained the exact same declarations. To simplify this I combined the class selectors into one rule set based on what was the same. For example

.benefit-lead, .benefit-brand, .benefit-cost
{
    margin-bottom: 32px;
    color: #ffffff;
}

The commas specify each new class selector that will use the declarations specified.

You can view the working site here Code Refactor Thank you ๐Ÿ˜ƒ

Code Refactor

code-refactor's People

Contributors

nkrilis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.